var I18N={lang:"fr",glp:function(d){var a=$A(arguments);var c=I18N[a.shift()];if(!c){return d}for(var b=0;b=32){return d}for(var b=0;b0){a=JSONRpcClient.async_responses.shift();if(a.canceled){continue}if(a.profile){a.profile.dispatch=new Date()}try{a.cb(a.result,a.ex,a.profile)}catch(c){JSONRpcClient.toplevel_ex_handler(c)}}while(JSONRpcClient.async_requests.length>0&&JSONRpcClient.num_req_active0){return JSONRpcClient.http_spare.pop()}return JSONRpcClient.getHTTPRequest()};JSONRpcClient.poolReturnHTTPRequest=function(a){if(JSONRpcClient.http_spare.length>=JSONRpcClient.http_max_spare){delete a}else{JSONRpcClient.http_spare.push(a)}};JSONRpcClient.msxmlNames=["MSXML2.XMLHTTP.6.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","MSXML2.XMLHTTP.5.0","MSXML2.XMLHTTP.4.0","Microsoft.XMLHTTP"];JSONRpcClient.getHTTPRequest=function(){try{JSONRpcClient.httpObjectName="XMLHttpRequest";return new XMLHttpRequest()}catch(b){}for(var a=0;a-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b),Chrome:b.indexOf("Chrome")>-1}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Class=(function(){var d=(function(){for(var e in {toString:1}){if(e==="toString"){return false}}return true})();function a(){}function b(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function e(){this.initialize.apply(this,arguments)}Object.extend(e,Class.Methods);e.superclass=h;e.subclasses=[];if(h){a.prototype=h.prototype;e.prototype=new a;h.subclasses.push(e)}for(var f=0,j=g.length;f0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&").replace(//g,">")}function unescapeHTML(){return this.stripTags().replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")}var f=d[1]||"";if(f=="\\"){return d[2]}var b=a,g=d[3],e=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=e.exec(g);if(d==null){return f}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}g=g.substring("["==d[3]?d[1].length:d[0].length);d=e.exec(g)}return f+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(A,z){var y=0;try{this._each(function(C){A.call(z,C,y++)})}catch(B){if(B!=$break){throw B}}return this}function t(B,A,z){var y=-B,C=[],D=this.toArray();if(B<1){return D}while((y+=B)=y){y=C}});return y}function o(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||CA?1:0}).pluck("value")}function p(){return this.map()}function u(){var z=Prototype.K,y=$A(arguments);if(Object.isFunction(y.last())){z=y.pop()}var A=[this].concat(y).map($A);return this.map(function(C,B){return z(A.pluck(B))})}function l(){return this.toArray().length}function w(){return"#"}return{each:c,eachSlice:t,all:b,every:b,any:j,some:j,collect:k,map:k,detect:v,findAll:h,select:h,filter:h,grep:g,include:a,member:a,inGroupsOf:s,inject:m,invoke:x,max:q,min:o,partition:e,pluck:f,reject:d,sortBy:n,toArray:p,entries:p,zip:u,size:l,inspect:w,find:v}})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var t=Array.prototype,n=t.slice,p=t.forEach;function b(y,x){for(var w=0,z=this.length>>>0;w"}function h(){return new Hash(this)}return{initialize:e,_each:f,set:k,get:c,unset:n,toObject:p,toTemplateReplacements:p,keys:o,values:m,index:g,merge:j,update:d,toQueryString:a,inspect:l,toJSON:p,clone:h}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function h(k,j){$R(0,this,true).each(k,j);return this}function g(l,k){var j=this.toString(k||10);return"0".times(l-j.length)+j}function a(){return Math.abs(this)}function c(){return Math.round(this)}function e(){return Math.ceil(this)}function f(){return Math.floor(this)}return{toColorPart:d,succ:b,times:h,toPaddedString:g,abs:a,round:c,ceil:e,floor:f}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(f,d,e){this.start=f;this.end=d;this.exclusive=e}function c(d){var e=this.start;while(this.include(e)){d(e);e=e.succ()}}function a(d){if(d1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(e,f){this.updateContent(e.responseText);if(Object.isFunction(d)){d(e,f)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){d=d.stripScripts()}if(c=$(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;a');return e.tagName.toLowerCase()==="input"&&e.name==="x"}catch(f){return false}})();var a=c.Element;c.Element=function(g,f){f=f||{};g=g.toLowerCase();var e=Element.cache;if(b&&f.name){g="<"+g+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(g),f)}if(!e[g]){e[g]=Element.extend(document.createElement(g))}var h=d(g,f)?e[g].cloneNode(false):document.createElement(g);return Element.writeAttribute(h,f)};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var a=b._prototypeUID;if(a){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[a]}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var d=(function(){var g=document.createElement("select"),h=true;g.innerHTML='';if(g.options&&g.options[0]){h=g.options[0].nodeName.toUpperCase()!=="OPTION"}g=null;return h})();var b=(function(){try{var g=document.createElement("table");if(g&&g.tBodies){g.innerHTML="test";var j=typeof g.tBodies[0]=="undefined";g=null;return j}}catch(h){return true}})();var a=(function(){try{var g=document.createElement("div");g.innerHTML="";var j=(g.childNodes.length===0);g=null;return j}catch(h){return true}})();var c=d||b||a;var f=(function(){var g=document.createElement("script"),j=false;try{g.appendChild(document.createTextNode(""));j=!g.firstChild||g.firstChild&&g.firstChild.nodeType!==3}catch(h){j=true}g=null;return j})();function e(l,m){l=$(l);var g=Element._purgeElement;var n=l.getElementsByTagName("*"),k=n.length;while(k--){g(n[k])}if(m&&m.toElement){m=m.toElement()}if(Object.isElement(m)){return l.update().insert(m)}m=Object.toHTML(m);var j=l.tagName.toUpperCase();if(j==="SCRIPT"&&f){l.text=m;return l}if(c){if(j in Element._insertionTranslations.tags){while(l.firstChild){l.removeChild(l.firstChild)}Element._getContentFromAnonymousElement(j,m.stripScripts()).each(function(o){l.appendChild(o)})}else{if(a&&Object.isString(m)&&m.indexOf("-1){while(l.firstChild){l.removeChild(l.firstChild)}var h=Element._getContentFromAnonymousElement(j,m.stripScripts(),true);h.each(function(o){l.appendChild(o)})}else{l.innerHTML=m.stripScripts()}}}else{l.innerHTML=m.stripScripts()}m.evalScripts.bind(m).defer();return l}return e})(),replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,e){c=$(c);if(Object.isString(e)||Object.isNumber(e)||Object.isElement(e)||(e&&(e.toElement||e.toHTML))){e={bottom:e}}var d,f,b,g;for(var a in e){d=e[a];a=a.toLowerCase();f=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()}if(Object.isElement(d)){f(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){g.reverse()}g.each(f.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var e=f.first(),c=f.last(),d=(b[e]||"").toString();if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c,d){a=$(a);d=d||-1;var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==d){break}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(b){var a=[],c=$(b).firstChild;while(c){if(c.nodeType===1){a.push(Element.extend(c))}c=c.nextSibling}return a},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){b=$(b);if(Object.isString(a)){return Prototype.Selector.match(b,a)}return a.match(b)},up:function(b,d,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var c=Element.ancestors(b);return Object.isNumber(d)?c[d]:Prototype.Selector.find(c,d,a)},down:function(b,c,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,c,a){b=$(b);if(Object.isNumber(c)){a=c,c=false}if(!Object.isNumber(a)){a=0}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,d,a){b=$(b);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.nextSiblings(),d,a)}else{var c=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(c,a){c=$(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(e,c,f){e=$(e);var b={},d=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=d.names[a]||a;f=b[a];if(d.values[a]){c=d.values[a](e,f)}if(f===false||f===null){e.removeAttribute(c)}else{if(f===true){e.setAttribute(c,c)}else{e.setAttribute(c,f)}}}return e},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=$(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,c){b=$(b);var e=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{e[(d=="float"||d=="cssFloat")?(Object.isUndefined(e.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});d=$(d);var e=Element.viewportOffset(d),f=[0,0],c=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);f=Element.viewportOffset(c)}if(c==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(e[0]-f[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(e[1]-f[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"height":case"width":if(!Element.visible(b)){return null}var e=parseInt(d(b,c),10);if(e!==b["offset"+c.capitalize()]){return e+"px"}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(e,function(f,g){var h=d(b,g);return h===null?f:f-parseInt(h,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(e==1||e===""){(d=f(d))?c.filter=d:c.removeAttribute("filter");return b}else{if(e<0.00001){e=0}}c.filter=f(d)+"alpha(opacity="+(e*100)+")";return b};Element._attributeTranslations=(function(){var b="className",a="for",c=document.createElement("div");c.setAttribute(b,"x");if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x"){b="class"}}c=null;c=document.createElement("label");c.setAttribute(a,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x"){a="htmlFor"}}c=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,e){return d.getAttribute(e)},_getAttr2:function(d,e){return d.getAttribute(e,2)},_getAttrNode:function(d,f){var e=d.getAttributeNode(f);return e?e.value:""},_getEv:(function(){var d=document.createElement("div"),g;d.onclick=Prototype.emptyFunction;var e=d.getAttribute("onclick");if(String(e).indexOf("{")>-1){g=function(f,h){h=f.getAttribute(h);if(!h){return null}h=h.toString();h=h.split("{")[1];h=h.split("}")[0];return h.strip()}}else{if(e===""){g=function(f,h){h=f.getAttribute(h);if(!h){return null}return h.strip()}}}d=null;return g})(),_flag:function(d,e){return $(d).hasAttribute(e)?e:null},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(e){var b=e.getElementsByTagName("*"),d=[];for(var c=0,f;f=b[c];c++){if(f.tagName!=="!"){d.push(f)}}return d}Element.Methods.down=function(c,d,b){c=$(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,e){c=$(c);if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){c.parentNode.replaceChild(e,c);return c}e=Object.toHTML(e);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var f=c.next(),a=Element._getContentFromAnonymousElement(b,e.stripScripts());d.removeChild(c);if(f){a.each(function(g){d.insertBefore(g,f)})}else{a.each(function(g){d.appendChild(g)})}}else{c.outerHTML=e.stripScripts()}e.evalScripts.bind(e).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(e,d,f){var g=new Element("div"),c=Element._insertionTranslations.tags[e];var a=false;if(c){a=true}else{if(f){a=true;c=["","",0]}}if(a){g.innerHTML=" "+c[0]+d+c[1];g.removeChild(g.firstChild);for(var b=c[2];b--;){g=g.firstChild}}else{g.innerHTML=d}return $A(g.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["","
",1],TBODY:["","
",2],TR:["","
",3],TD:["
","
",4],SELECT:["",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function c(g){if(typeof window.Element!="undefined"){var j=window.Element.prototype;if(j){var l="_"+(Math.random()+"").slice(2),h=document.createElement(g);j[l]="x";var k=(h[l]!=="x");delete j[l];h=null;return k}}return false}function b(h,g){for(var k in g){var j=g[k];if(Object.isFunction(j)&&!(k in h)){h[k]=j.methodize()}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(h){if(h&&typeof h._extendedByPrototype=="undefined"){var g=h.tagName;if(g&&(/^(?:object|applet|embed)$/i.test(g))){b(h,Element.Methods);b(h,Element.Methods.Simulated);b(h,Element.Methods.ByTag[g.toUpperCase()])}}return h}}return Prototype.K}var a={},e=Element.Methods.ByTag;var f=Object.extend(function(j){if(!j||typeof j._extendedByPrototype!="undefined"||j.nodeType!=1||j==window){return j}var g=Object.clone(a),h=j.tagName.toUpperCase();if(e[h]){Object.extend(g,e[h])}b(j,g);j._extendedByPrototype=Prototype.emptyFunction;return j},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});f.refresh();return f})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(c){var j=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(g)}else{g(b)}}function g(l){l=l.toUpperCase();if(!Element.Methods.ByTag[l]){Element.Methods.ByTag[l]={}}Object.extend(Element.Methods.ByTag[l],c)}function a(n,m,l){l=l||false;for(var p in n){var o=n[p];if(!Object.isFunction(o)){continue}if(!l||!(p in m)){m[p]=o.methodize()}}}function e(o){var l;var n={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(n[o]){l="HTML"+n[o]+"Element"}if(window[l]){return window[l]}l="HTML"+o+"Element";if(window[l]){return window[l]}l="HTML"+o.capitalize()+"Element";if(window[l]){return window[l]}var m=document.createElement(o),p=m.__proto__||m.constructor.prototype;m=null;return p}var h=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(j.ElementExtensions){a(Element.Methods,h);a(Element.Methods.Simulated,h,true)}if(j.SpecificElementExtensions){for(var k in Element.Methods.ByTag){var f=e(k);if(Object.isUndefined(f)){continue}a(d[k],f.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(b){var g=Prototype.Browser,e=document,c,d={};function a(){if(g.WebKit&&!e.evaluate){return document}if(g.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function f(h){if(!c){c=a()}d[h]="client"+h;b["get"+h]=function(){return c[d[h]]};return b["get"+h]()}b.getWidth=f.curry("Width");b.getHeight=f.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=Element.Storage.UID++}a=b._prototypeUID}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,c){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,c)}return b},retrieve:function(c,b,a){if(!(c=$(c))){return}var e=Element.getStorage(c),d=e.get(b);if(Object.isUndefined(d)){e.set(b,a);d=a}return d},clone:function(c,a){if(!(c=$(c))){return}var e=c.cloneNode(a);e._prototypeUID=void 0;if(a){var d=Element.select(e,"*"),b=d.length;while(b--){d[b]._prototypeUID=void 0}}return Element.extend(e)},purge:function(c){if(!(c=$(c))){return}var a=Element._purgeElement;a(c);var d=c.getElementsByTagName("*"),b=d.length;while(b--){a(d[b])}return null}});(function(){function h(x){var w=x.match(/^(\d+)%?$/i);if(!w){return null}return(Number(w[1])/100)}function p(H,I,x){var A=null;if(Object.isElement(H)){A=H;H=A.getStyle(I)}if(H===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(H)){return window.parseFloat(H)}var C=H.include("%"),y=(x===document.viewport);if(/\d/.test(H)&&A&&A.runtimeStyle&&!(C&&y)){var w=A.style.left,G=A.runtimeStyle.left;A.runtimeStyle.left=A.currentStyle.left;A.style.left=H||0;H=A.style.pixelLeft;A.style.left=w;A.runtimeStyle.left=G;return H}if(A&&C){x=x||A.parentNode;var z=h(H);var D=null;var B=A.getStyle("position");var F=I.include("left")||I.include("right")||I.include("width");var E=I.include("top")||I.include("bottom")||I.include("height");if(x===document.viewport){if(F){D=document.viewport.getWidth()}else{if(E){D=document.viewport.getHeight()}}}else{if(F){D=$(x).measure("width")}else{if(E){D=$(x).measure("height")}}}return(D===null)?0:D*z}return 0}function g(w){if(Object.isString(w)&&w.endsWith("px")){return w}return w+"px"}function k(x){var w=x;while(x&&x.parentNode){var y=x.getStyle("display");if(y==="none"){return false}x=$(x.parentNode)}return true}var d=Prototype.K;if("currentStyle" in document.documentElement){d=function(w){if(!w.currentStyle.hasLayout){w.style.zoom=1}return w}}function f(w){if(w.include("border")){w=w+"-width"}return w.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,x,w){$super();this.element=$(x);Element.Layout.PROPERTIES.each(function(y){this._set(y,null)},this);if(w){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(x,w){return Hash.prototype.set.call(this,x,w)},set:function(x,w){throw"Properties of Element.Layout are read-only."},get:function($super,x){var w=$super(x);return w===null?this._compute(x):w},_begin:function(){if(this._prepared){return}var A=this.element;if(k(A)){this._prepared=true;return}var C={position:A.style.position||"",width:A.style.width||"",visibility:A.style.visibility||"",display:A.style.display||""};A.store("prototype_original_styles",C);var D=A.getStyle("position"),w=A.getStyle("width");if(w==="0px"||w===null){A.style.display="block";w=A.getStyle("width")}var x=(D==="fixed")?document.viewport:A.parentNode;A.setStyle({position:"absolute",visibility:"hidden",display:"block"});var y=A.getStyle("width");var z;if(w&&(y===w)){z=p(A,"width",x)}else{if(D==="absolute"||D==="fixed"){z=p(A,"width",x)}else{var E=A.parentNode,B=$(E).getLayout();z=B.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}A.setStyle({width:z+"px"});this._prepared=true},_end:function(){var x=this.element;var w=x.retrieve("prototype_original_styles");x.store("prototype_original_styles",null);x.setStyle(w);this._prepared=false},_compute:function(x){var w=Element.Layout.COMPUTATIONS;if(!(x in w)){throw"Property not found."}return this._set(x,w[x].call(this,this.element))},toObject:function(){var w=$A(arguments);var x=(w.length===0)?Element.Layout.PROPERTIES:w.join(" ").split(" ");var y={};x.each(function(z){if(!Element.Layout.PROPERTIES.include(z)){return}var A=this.get(z);if(A!=null){y[z]=A}},this);return y},toHash:function(){var w=this.toObject.apply(this,arguments);return new Hash(w)},toCSS:function(){var w=$A(arguments);var y=(w.length===0)?Element.Layout.PROPERTIES:w.join(" ").split(" ");var x={};y.each(function(z){if(!Element.Layout.PROPERTIES.include(z)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(z)){return}var A=this.get(z);if(A!=null){x[f(z)]=A+"px"}},this);return x},inspect:function(){return"#"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(y){if(!this._preComputing){this._begin()}var w=this.get("border-box-height");if(w<=0){if(!this._preComputing){this._end()}return 0}var z=this.get("border-top"),x=this.get("border-bottom");var B=this.get("padding-top"),A=this.get("padding-bottom");if(!this._preComputing){this._end()}return w-z-x-B-A},width:function(y){if(!this._preComputing){this._begin()}var x=this.get("border-box-width");if(x<=0){if(!this._preComputing){this._end()}return 0}var B=this.get("border-left"),w=this.get("border-right");var z=this.get("padding-left"),A=this.get("padding-right");if(!this._preComputing){this._end()}return x-B-w-z-A},"padding-box-height":function(x){var w=this.get("height"),z=this.get("padding-top"),y=this.get("padding-bottom");return w+z+y},"padding-box-width":function(w){var x=this.get("width"),y=this.get("padding-left"),z=this.get("padding-right");return x+y+z},"border-box-height":function(x){if(!this._preComputing){this._begin()}var w=x.offsetHeight;if(!this._preComputing){this._end()}return w},"border-box-width":function(w){if(!this._preComputing){this._begin()}var x=w.offsetWidth;if(!this._preComputing){this._end()}return x},"margin-box-height":function(x){var w=this.get("border-box-height"),y=this.get("margin-top"),z=this.get("margin-bottom");if(w<=0){return 0}return w+y+z},"margin-box-width":function(y){var x=this.get("border-box-width"),z=this.get("margin-left"),w=this.get("margin-right");if(x<=0){return 0}return x+z+w},top:function(w){var x=w.positionedOffset();return x.top},bottom:function(w){var z=w.positionedOffset(),x=w.getOffsetParent(),y=x.measure("height");var A=this.get("border-box-height");return y-A-z.top},left:function(w){var x=w.positionedOffset();return x.left},right:function(y){var A=y.positionedOffset(),z=y.getOffsetParent(),w=z.measure("width");var x=this.get("border-box-width");return w-x-A.left},"padding-top":function(w){return p(w,"paddingTop")},"padding-bottom":function(w){return p(w,"paddingBottom")},"padding-left":function(w){return p(w,"paddingLeft")},"padding-right":function(w){return p(w,"paddingRight")},"border-top":function(w){return p(w,"borderTopWidth")},"border-bottom":function(w){return p(w,"borderBottomWidth")},"border-left":function(w){return p(w,"borderLeftWidth")},"border-right":function(w){return p(w,"borderRightWidth")},"margin-top":function(w){return p(w,"marginTop")},"margin-bottom":function(w){return p(w,"marginBottom")},"margin-left":function(w){return p(w,"marginLeft")},"margin-right":function(w){return p(w,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(x){var y=d(x.getOffsetParent());var z=x.getBoundingClientRect(),w=y.getBoundingClientRect();return(w.right-z.right).round()},bottom:function(x){var y=d(x.getOffsetParent());var z=x.getBoundingClientRect(),w=y.getBoundingClientRect();return(w.bottom-z.bottom).round()}})}Element.Offset=Class.create({initialize:function(x,w){this.left=x.round();this.top=w.round();this[0]=this.left;this[1]=this.top},relativeTo:function(w){return new Element.Offset(this.left-w.left,this.top-w.top)},inspect:function(){return"#".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function t(x,w){return new Element.Layout(x,w)}function b(w,x){return $(w).getLayout().get(x)}function o(x){x=$(x);var B=Element.getStyle(x,"display");if(B&&B!=="none"){return{width:x.offsetWidth,height:x.offsetHeight}}var y=x.style;var w={visibility:y.visibility,position:y.position,display:y.display};var A={visibility:"hidden",display:"block"};if(w.position!=="fixed"){A.position="absolute"}Element.setStyle(x,A);var z={width:x.offsetWidth,height:x.offsetHeight};Element.setStyle(x,w);return z}function m(w){w=$(w);if(e(w)||c(w)||n(w)||l(w)){return $(document.body)}var x=(Element.getStyle(w,"display")==="inline");if(!x&&w.offsetParent){return $(w.offsetParent)}while((w=w.parentNode)&&w!==document.body&&Object.isElement(w)){if(Element.getStyle(w,"position")!=="static"){return l(w)?$(document.body):$(w)}}return $(document.body)}function v(x){x=$(x);var w=0,y=0;if(x.parentNode){do{w+=x.offsetTop||0;y+=x.offsetLeft||0;x=x.offsetParent}while(x)}return new Element.Offset(y,w)}function q(x){x=$(x);var y=x.getLayout();var w=0,A=0;do{w+=x.offsetTop||0;A+=x.offsetLeft||0;x=x.offsetParent;if(x){if(n(x)){break}var z=Element.getStyle(x,"position");if(z!=="static"){break}}}while(x);A-=y.get("margin-top");w-=y.get("margin-left");return new Element.Offset(A,w)}function a(x){var w=0,y=0;do{w+=x.scrollTop||0;y+=x.scrollLeft||0;x=x.parentNode}while(x);return new Element.Offset(y,w)}function u(A){x=$(x);var w=0,z=0,y=document.body;var x=A;do{w+=x.offsetTop||0;z+=x.offsetLeft||0;if(x.offsetParent==y&&Element.getStyle(x,"position")=="absolute"){break}}while(x=x.offsetParent);x=A;do{if(x!=y){w-=x.scrollTop||0;z-=x.scrollLeft||0}}while(x=x.parentNode);return new Element.Offset(z,w)}function s(w){w=$(w);if(Element.getStyle(w,"position")==="absolute"){return w}var A=m(w);var z=w.viewportOffset(),x=A.viewportOffset();var B=z.relativeTo(x);var y=w.getLayout();w.store("prototype_absolutize_original_styles",{left:w.getStyle("left"),top:w.getStyle("top"),width:w.getStyle("width"),height:w.getStyle("height")});w.setStyle({position:"absolute",top:B.top+"px",left:B.left+"px",width:y.get("width")+"px",height:y.get("height")+"px"});return w}function j(x){x=$(x);if(Element.getStyle(x,"position")==="relative"){return x}var w=x.retrieve("prototype_absolutize_original_styles");if(w){x.setStyle(w)}return x}if(Prototype.Browser.IE){m=m.wrap(function(y,x){x=$(x);if(e(x)||c(x)||n(x)||l(x)){return $(document.body)}var w=x.getStyle("position");if(w!=="static"){return y(x)}x.setStyle({position:"relative"});var z=y(x);x.setStyle({position:w});return z});q=q.wrap(function(z,x){x=$(x);if(!x.parentNode){return new Element.Offset(0,0)}var w=x.getStyle("position");if(w!=="static"){return z(x)}var y=x.getOffsetParent();if(y&&y.getStyle("position")==="fixed"){d(y)}x.setStyle({position:"relative"});var A=z(x);x.setStyle({position:w});return A})}else{if(Prototype.Browser.Webkit){v=function(x){x=$(x);var w=0,y=0;do{w+=x.offsetTop||0;y+=x.offsetLeft||0;if(x.offsetParent==document.body){if(Element.getStyle(x,"position")=="absolute"){break}}x=x.offsetParent}while(x);return new Element.Offset(y,w)}}}Element.addMethods({getLayout:t,measure:b,getDimensions:o,getOffsetParent:m,cumulativeOffset:v,positionedOffset:q,cumulativeScrollOffset:a,viewportOffset:u,absolutize:s,relativize:j});function n(w){return w.nodeName.toUpperCase()==="BODY"}function l(w){return w.nodeName.toUpperCase()==="HTML"}function e(w){return w.nodeType===Node.DOCUMENT_NODE}function c(w){return w!==document.body&&!Element.descendantOf(w,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(w){w=$(w);if(c(w)){return new Element.Offset(0,0)}var x=w.getBoundingClientRect(),y=document.documentElement;return new Element.Offset(x.left-y.clientLeft,x.top-y.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(l,m,h){h=h||0;var g=Prototype.Selector.match,k=l.length,f=0,j;for(j=0;j+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,k=0,d=Object.prototype.toString,p=false,j=true;[0,0].sort(function(){j=false;return 0});var b=function(G,w,D,y){D=D||[];var e=w=w||document;if(w.nodeType!==1&&w.nodeType!==9){return[]}if(!G||typeof G!=="string"){return D}var E=[],F,B,K,J,C,v,u=true,z=q(w),I=G;while((s.exec(""),F=s.exec(I))!==null){I=F[3];E.push(F[1]);if(F[2]){v=F[3];break}}if(E.length>1&&l.exec(G)){if(E.length===2&&f.relative[E[0]]){B=g(E[0]+E[1],w)}else{B=f.relative[E[0]]?[w]:b(E.shift(),w);while(E.length){G=E.shift();if(f.relative[G]){G+=E.shift()}B=g(G,B)}}}else{if(!y&&E.length>1&&w.nodeType===9&&!z&&f.match.ID.test(E[0])&&!f.match.ID.test(E[E.length-1])){var L=b.find(E.shift(),w,z);w=L.expr?b.filter(L.expr,L.set)[0]:L.set[0]}if(w){var L=y?{expr:E.pop(),set:a(y)}:b.find(E.pop(),E.length===1&&(E[0]==="~"||E[0]==="+")&&w.parentNode?w.parentNode:w,z);B=L.expr?b.filter(L.expr,L.set):L.set;if(E.length>0){K=a(B)}else{u=false}while(E.length){var x=E.pop(),A=x;if(!f.relative[x]){x=""}else{A=E.pop()}if(A==null){A=w}f.relative[x](K,A,z)}}else{K=E=[]}}if(!K){K=B}if(!K){throw"Syntax error, unrecognized expression: "+(x||G)}if(d.call(K)==="[object Array]"){if(!u){D.push.apply(D,K)}else{if(w&&w.nodeType===1){for(var H=0;K[H]!=null;H++){if(K[H]&&(K[H]===true||K[H].nodeType===1&&h(w,K[H]))){D.push(B[H])}}}else{for(var H=0;K[H]!=null;H++){if(K[H]&&K[H].nodeType===1){D.push(B[H])}}}}}else{a(K,D)}if(v){b(v,e,D,y);b.uniqueSort(D)}return D};b.uniqueSort=function(u){if(c){p=j;u.sort(c);if(p){for(var e=1;e":function(z,u,A){var x=typeof u==="string";if(x&&!/\W/.test(u)){u=A?u:u.toUpperCase();for(var v=0,e=z.length;v=0)){if(!v){e.push(y)}}else{if(v){u[x]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(u,e){for(var v=0;e[v]===false;v++){}return e[v]&&q(e[v])?u[1]:u[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var u=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(u[1]+(u[2]||1))-0;e[3]=u[3]-0}e[0]=k++;return e},ATTR:function(x,u,v,e,y,z){var w=x[1].replace(/\\/g,"");if(!z&&f.attrMap[w]){x[1]=f.attrMap[w]}if(x[2]==="~="){x[4]=" "+x[4]+" "}return x},PSEUDO:function(x,u,v,e,y){if(x[1]==="not"){if((s.exec(x[3])||"").length>1||/^\w/.test(x[3])){x[3]=b(x[3],null,null,u)}else{var w=b.filter(x[3],u,v,true^y);if(!v){e.push.apply(e,w)}return false}}else{if(f.match.POS.test(x[0])||f.match.CHILD.test(x[0])){return true}}return x},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(v,u,e){return !!b(e[3],v).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(u,e){return e===0},last:function(v,u,e,w){return u===w.length-1},even:function(u,e){return e%2===0},odd:function(u,e){return e%2===1},lt:function(v,u,e){return ue[3]-0},nth:function(v,u,e){return e[3]-0==u},eq:function(v,u,e){return e[3]-0==u}},filter:{PSEUDO:function(z,v,w,A){var u=v[1],x=f.filters[u];if(x){return x(z,w,v,A)}else{if(u==="contains"){return(z.textContent||z.innerText||"").indexOf(v[3])>=0}else{if(u==="not"){var y=v[3];for(var w=0,e=y.length;w=0)}}},ID:function(u,e){return u.nodeType===1&&u.getAttribute("id")===e},TAG:function(u,e){return(e==="*"&&u.nodeType===1)||u.nodeName===e},CLASS:function(u,e){return(" "+(u.className||u.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(y,w){var v=w[1],e=f.attrHandle[v]?f.attrHandle[v](y):y[v]!=null?y[v]:y.getAttribute(v),z=e+"",x=w[2],u=w[4];return e==null?x==="!=":x==="="?z===u:x==="*="?z.indexOf(u)>=0:x==="~="?(" "+z+" ").indexOf(u)>=0:!u?z&&e!==false:x==="!="?z!=u:x==="^="?z.indexOf(u)===0:x==="$="?z.substr(z.length-u.length)===u:x==="|="?z===u||z.substr(0,u.length+1)===u+"-":false},POS:function(x,u,v,y){var e=u[2],w=f.setFilters[e];if(w){return w(x,v,u,y)}}}};var l=f.match.POS;for(var n in f.match){f.match[n]=new RegExp(f.match[n].source+/(?![^\[]*\])(?![^\(]*\))/.source);f.leftMatch[n]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[n].source)}var a=function(u,e){u=Array.prototype.slice.call(u,0);if(e){e.push.apply(e,u);return e}return u};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(m){a=function(x,w){var u=w||[];if(d.call(x)==="[object Array]"){Array.prototype.push.apply(u,x)}else{if(typeof x.length==="number"){for(var v=0,e=x.length;v";var e=document.documentElement;e.insertBefore(u,e.firstChild);if(!!document.getElementById(v)){f.find.ID=function(x,y,z){if(typeof y.getElementById!=="undefined"&&!z){var w=y.getElementById(x[1]);return w?w.id===x[1]||typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id").nodeValue===x[1]?[w]:undefined:[]}};f.filter.ID=function(y,w){var x=typeof y.getAttributeNode!=="undefined"&&y.getAttributeNode("id");return y.nodeType===1&&x&&x.nodeValue===w}}e.removeChild(u);e=u=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(u,y){var x=y.getElementsByTagName(u[1]);if(u[1]==="*"){var w=[];for(var v=0;x[v];v++){if(x[v].nodeType===1){w.push(x[v])}}x=w}return x}}e.innerHTML="";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(u){return u.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,v=document.createElement("div");v.innerHTML="

";if(v.querySelectorAll&&v.querySelectorAll(".TEST").length===0){return}b=function(z,y,w,x){y=y||document;if(!x&&y.nodeType===9&&!q(y)){try{return a(y.querySelectorAll(z),w)}catch(A){}}return e(z,y,w,x)};for(var u in e){b[u]=e[u]}v=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="
";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(u,v,w){if(typeof v.getElementsByClassName!=="undefined"&&!w){return v.getElementsByClassName(u[1])}};e=null})()}function o(u,z,y,D,A,C){var B=u=="previousSibling"&&!C;for(var w=0,v=D.length;w0){x=e;break}}}e=e[u]}D[w]=x}}}var h=document.compareDocumentPosition?function(u,e){return u.compareDocumentPosition(e)&16}:function(u,e){return u!==e&&(u.contains?u.contains(e):true)};var q=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,A){var w=[],x="",y,v=A.nodeType?[A]:A;while((y=f.match.PSEUDO.exec(e))){x+=y[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var z=0,u=v.length;z=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,a){b=$(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function b(h,j){switch(h.type.toLowerCase()){case"checkbox":case"radio":return f(h,j);default:return e(h,j)}}function f(h,j){if(Object.isUndefined(j)){return h.checked?h.value:null}else{h.checked=!!j}}function e(h,j){if(Object.isUndefined(j)){return h.value}else{h.value=j}}function a(k,n){if(Object.isUndefined(n)){return(k.type==="select-one"?c:d)(k)}var j,l,o=!Object.isArray(n);for(var h=0,m=k.length;h=0?g(j.options[h]):null}function d(l){var h,m=l.length;if(!m){return null}for(var k=0,h=[];k=this.offset[1]&&c=this.offset[0]&&a=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#"}});Object.extend(Selector,{matchElements:function(f,g){var a=Prototype.Selector.match,d=[];for(var c=0,e=f.length;c1?a:a[0]},write:function(b,a){if(b.constructor==Object&&b.name){b=[b]}if(b.constructor==Array){$A(b).each(function(c){this._write(c.name,c.value,c.expires,c.path,c.domain)}.bind(this))}else{a=a||{expires:false,path:"",domain:""};for(name in b){this._write(name,b[name],a.expires,a.path,a.domain)}}},_write:function(b,e,a,f,d){if(b.indexOf("=")!=-1){return}var c=b+"="+escape(e);if(a){c+="; expires="+a.toGMTString()}if(f){c+="; path="+f}if(d){c+="; domain="+d}document.cookie=c},erase:function(a){var b={};$A(arguments).each(function(c){b[c]=""});this.write(b,{expires:(new Date((new Date()).getTime()-100000000000))});this.getAll()},eraseAll:function(){this.erase.apply(this,$H(this.getAll()).keys())}};Object.extend(Cookie,{get:Cookie.read,set:Cookie.write,add:Cookie.read,remove:Cookie.erase,removeAll:Cookie.eraseAll,wipe:Cookie.erase,wipeAll:Cookie.eraseAll,destroy:Cookie.erase,destroyAll:Cookie.eraseAll});if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(n,b,o,e,k,l,g,f,d,m){if(!document.getElementById){return}this.DETECT_KEY=m?m:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(n){this.setAttribute("swf",n)}if(b){this.setAttribute("id",b)}if(o){this.setAttribute("width",o)}if(e){this.setAttribute("height",e)}if(k){this.setAttribute("version",new deconcept.PlayerVersion(k.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(l){this.addParam("bgcolor",l)}var a=g?g:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var j=(f)?f:window.location;this.setAttribute("xiRedirectUrl",j);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var c=new Array();var b;var a=this.getVariables();for(b in a){c[c.length]=b+"="+a[b]}return c},getSWFHTML:function(){var b="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}b='0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}b='';b+='';var c=this.getParams();for(var e in c){b+=''}var a=this.getVariablePairs().join("&");if(a.length>0){b+=''}b+=""}return b},write:function(b){if(this.getAttribute("useExpressInstall")){var a=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var f=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){f=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1;var c=3;while(b){try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);f=new deconcept.PlayerVersion([c,0,0])}catch(d){b=null}}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(d){if(f.major==6){return f}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(b!=null){f=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}}return f};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.majora.major){return true}if(this.minora.minor){return true}if(this.rev=0;c--){b[c].style.display="none";for(var a in b[c]){if(typeof b[c][a]=="function"){b[c][a]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a){a=a.toUpperCase();var g=this.NODEMAP[a]||"div";var b=document.createElement(g);try{b.innerHTML="<"+a+">"}catch(f){}var d=b.firstChild||null;if(d&&(d.tagName.toUpperCase()!=a)){d=d.getElementsByTagName(a)[0]}if(!d){d=document.createElement(a)}if(!d){return}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1] instanceof Array)||arguments[1].tagName){this._children(d,arguments[1])}else{var c=this._attributes(arguments[1]);if(c.length){try{b.innerHTML="<"+a+" "+c+">"}catch(f){}d=b.firstChild||null;if(!d){d=document.createElement(a);for(attr in arguments[1]){d[attr=="class"?"className":attr]=arguments[1][attr]}}if(d.tagName.toUpperCase()!=a){d=b.getElementsByTagName(a)[0]}}}}if(arguments[2]){this._children(d,arguments[2])}return $(d)},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];for(attribute in a){b.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,""")+'"')}return b.join(" ")},_children:function(b,a){if(a.tagName){b.appendChild(a);return}if(typeof a=="object"){a.flatten().each(function(c){if(typeof c=="object"){b.appendChild(c)}else{if(Builder._isStringOrNumber(c)){b.appendChild(Builder._text(c))}}})}else{if(Builder._isStringOrNumber(a)){b.appendChild(Builder._text(a))}}},_isStringOrNumber:function(a){return(typeof a=="string"||typeof a=="number")},build:function(b){var a=this.node("div");$(a).update(b.strip());return a.down()},dump:function(b){if(typeof b!="object"&&typeof b!="function"){b=window}var a=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);a.each(function(c){b[c]=function(){return Builder.node.apply(Builder,[c].concat($A(arguments)))}})}};String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)});Element.remove(c)}})},multiple:function(b,c){var e;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){e=b}else{e=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;$A(e).each(function(g,f){new c(g,Object.extend(a,{delay:f*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c,a){b=$(b);c=(c||"appear").toLowerCase();return Effect[Effect.PAIRS[c][b.visible()?1:0]](b,Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},a||{}))}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])}}return"#"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,f,e){c=Object.isString(c)?$(c):c;var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(g){c[d]=g};this.start(Object.extend({from:f,to:e},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,e){var f={};if(this.options.scaleX){f.width=e.round()+"px"}if(this.options.scaleY){f.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(e-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){f.top=this.originalTop-c+"px"}if(this.options.scaleX){f.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){f.top=-c+"px"}if(this.options.scaleX){f.left=-b+"px"}}}this.element.setStyle(f)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();if(b.offset){d[1]+=b.offset}return new Effect.Tween(null,a.top,d[1],b,function(e){scrollTo(a.left,e.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(d){d=$(d);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});var e=parseFloat(b.distance);var c=parseFloat(b.duration)/10;var a={top:d.getStyle("top"),left:d.getStyle("left")};return new Effect.Move(d,{x:e,y:0,duration:c,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(g){new Effect.Move(g.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-e*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:e*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:-e,y:0,duration:c,afterFinishInternal:function(l){l.element.undoPositioned().setStyle(a)}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var h,f;var e,d;switch(b.direction){case"top-left":h=f=e=d=0;break;case"top-right":h=g.width;f=d=0;e=-g.width;break;case"bottom-left":h=e=0;f=g.height;d=-g.height;break;case"bottom-right":h=g.width;f=g.height;e=-g.width;d=-g.height;break;case"center":h=g.width/2;f=g.height/2;e=-g.width/2;d=-g.height/2;break}return new Effect.Move(c,{x:h,y:f,duration:0.01,beforeSetup:function(j){j.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(j){new Effect.Parallel([new Effect.Opacity(j.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(j.element,{x:e,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(j.element,100,{scaleMode:{originalHeight:g.height,originalWidth:g.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(k){k.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(k){k.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var f=c.getDimensions();var e,d;switch(b.direction){case"top-left":e=d=0;break;case"top-right":e=f.width;d=0;break;case"bottom-left":e=0;d=f.height;break;case"bottom-right":e=f.width;d=f.height;break;case"center":e=f.width/2;d=f.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:e,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(g){g.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(g){g.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),e=b.transition||Effect.Transitions.linear,d=function(f){return 1-e((-Math.cos((f*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(f){f.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]});a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(e){d.element.style[e.style]=""})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)})}this.transforms=this.style.map(function(g){var f=g[0],e=g[1],d=null;if(e.parseColor("#zzzzzz")!="#zzzzzz"){e=e.parseColor();d="color"}else{if(f=="opacity"){e=parseFloat(e);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(e)){var c=e.match(/^([\+\-]?[0-9\.]+)(.*)$/);e=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(f);return{style:f.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(e):e,unit:d}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)}this.element.setStyle(d,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");var e=[$(d)||$$(d)].flatten();return e.map(function(f){return new c(f,Object.extend({sync:true},b))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='
';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=a[e];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(c,e,b){c=$(c);var d=e.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);return c},highlight:function(b,a){b=$(b);new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(b){return b.element==$(a)})},add:function(b){b=$(b);var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(a.containment){a._containers=[];var c=a.containment;if(Object.isArray(c)){c.each(function(d){a._containers.push($(d))})}else{a._containers.push($(c))}}if(a.accept){a.accept=[a.accept].flatten()}Element.makePositioned(b);a.element=b;this.drops.push(a)},findDeepestChild:function(a){deepest=a[0];for(i=1;i0){b=Droppables.findDeepestChild(d)}if(this.last_active&&this.last_active!=b){this.deactivate(this.last_active)}if(b){Position.within(b.element,a[0],a[1]);if(b.onHover){b.onHover(c,b.element,Position.overlap(b.overlap,b.element))}if(b!=this.last_active){Droppables.activate(b)}}},fire:function(b,a){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(b),Event.pointerY(b)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,b);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(a){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(a)},unregister:function(a){this.drags=this.drags.reject(function(b){return b==a});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable){return}var b=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==b.inspect())){return}this._lastPointer=b;this.activeDraggable.updateDrag(a,b)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)}},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b.element==a});this._cacheObserverCallbacks()},notify:function(b,a,c){if(this[b+"Count"]>0){this.observers.each(function(d){if(d[b]){d[b](b,a,c)}})}if(a.options[b]){a.options[b](a,c)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(b){return b[a]}).length})}};var Draggable=Class.create({initialize:function(b){var c={handle:false,reverteffect:function(f,e,d){var g=Math.sqrt(Math.abs(e^2)+Math.abs(d^2))*0.02;new Effect.Move(f,{x:-d,y:-e,duration:g,queue:{scope:"_draggable",position:"end"}})},endeffect:function(e){var d=Object.isNumber(e._opacity)?e._opacity:1;new Effect.Opacity(e,{duration:0.2,from:0.7,to:d,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[e]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(c,{starteffect:function(d){d._opacity=Element.getOpacity(d);Draggable._dragging[d]=true;new Effect.Opacity(d,{duration:0.2,from:d._opacity,to:0.7})}})}var a=Object.extend(c,arguments[1]||{});this.element=$(b);if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)}if(!this.handle){this.handle=$(a.handle)}if(!this.handle){this.handle=this.element}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);this._isScrollChild=Element.childOf(this.element,a.scroll)}Element.makePositioned(this.element);this.options=a;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(a)){var c=Event.element(a);if((tag_name=c.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var b=[Event.pointerX(a),Event.pointerY(a)];var d=this.element.cumulativeOffset();this.offset=[0,1].map(function(e){return(b[e]-d[e])});Draggables.activate(this);Event.stop(a)}},startDrag:function(b){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var a=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=a.left;this.originalScrollTop=a.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,b);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll).toArray();p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(b,f){this.dragging=false;if(this.options.quiet){Position.prepare();var e=[Event.pointerX(b),Event.pointerY(b)];Droppables.show(e,this.element)}if(this.options.ghosting){if(!this._originallyAbsolute){Position.relativize(this.element)}delete this._originallyAbsolute;Element.remove(this._clone);this._clone=null}var g=false;if(f){g=Droppables.fire(b,this.element);if(!g){g=false}}if(g&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,b);var a=this.options.revert;if(a&&Object.isFunction(a)){a=a(this.element)}var c=this.currentDelta();if(a&&this.options.reverteffect){if(g==0||a!="failure"){this.options.reverteffect(this.element,c[1]-this.delta[1],c[0]-this.delta[0])}}else{this.delta=c}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(a){if(a.keyCode!=Event.KEY_ESC){return}this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging){return}this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var g=this.element.cumulativeOffset();if(this.options.ghosting){var c=Position.realOffset(this.element);g[0]+=c[0]-Position.deltaX;g[1]+=c[1]-Position.deltaY}var f=this.currentDelta();g[0]-=f[0];g[1]-=f[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){g[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;g[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var e=[0,1].map(function(d){return(a[d]-g[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){e=this.options.snap(e[0],e[1],this)}else{if(Object.isArray(this.options.snap)){e=e.map(function(d,h){return(d/this.options.snap[h]).round()*this.options.snap[h]}.bind(this))}else{e=e.map(function(d){return(d/this.options.snap).round()*this.options.snap}.bind(this))}}}var b=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=e[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=e[1]+"px"}if(b.visibility=="hidden"){b.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1])){return}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(b,a){this.element=$(b);this.observer=a;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a}a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a){return}return Sortable.sortables[a.id]},destroy:function(a){a=$(a);var b=Sortable.sortables[a.id];if(b){Draggables.removeObserver(b.element);b.droppables.each(function(c){Droppables.remove(c)});b.draggables.invoke("destroy");delete Sortable.sortables[b.element.id]}},create:function(c){c=$(c);var b=Object.extend({element:c,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:c,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(c);var a={revert:true,quiet:b.quiet,scroll:b.scroll,scrollSpeed:b.scrollSpeed,scrollSensitivity:b.scrollSensitivity,delay:b.delay,ghosting:b.ghosting,constraint:b.constraint,handle:b.handle};if(b.starteffect){a.starteffect=b.starteffect}if(b.reverteffect){a.reverteffect=b.reverteffect}else{if(b.ghosting){a.reverteffect=function(f){f.style.top=0;f.style.left=0}}}if(b.endeffect){a.endeffect=b.endeffect}if(b.zindex){a.zindex=b.zindex}var d={overlap:b.overlap,containment:b.containment,tree:b.tree,hoverclass:b.hoverclass,onHover:Sortable.onHover};var e={onHover:Sortable.onEmptyHover,overlap:b.overlap,containment:b.containment,hoverclass:b.hoverclass};Element.cleanWhitespace(c);b.draggables=[];b.droppables=[];if(b.dropOnEmpty||b.tree){Droppables.add(c,e);b.droppables.push(c)}(b.elements||this.findElements(c,b)||[]).each(function(h,f){var g=b.handles?$(b.handles[f]):(b.handle?$(h).select("."+b.handle)[0]:h);b.draggables.push(new Draggable(h,Object.extend(a,{handle:g})));Droppables.add(h,d);if(b.tree){h.treeNode=c}b.droppables.push(h)});if(b.tree){(Sortable.findTreeElements(c,b)||[]).each(function(f){Droppables.add(f,e);f.treeNode=c;b.droppables.push(f)})}this.sortables[c.identify()]=b;Draggables.addObserver(new SortableObserver(c,b.onUpdate))},findElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.tag)},findTreeElements:function(b,a){return Element.findChildren(b,a.only,a.tree?true:false,a.treeTag)},onHover:function(e,d,a){if(Element.isParent(d,e)){return}if(a>0.33&&a<0.66&&Sortable.options(d).tree){return}else{if(a>0.5){Sortable.mark(d,"before");if(d.previousSibling!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,d);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}else{Sortable.mark(d,"after");var c=d.nextSibling||null;if(c!=e){var b=e.parentNode;e.style.visibility="hidden";d.parentNode.insertBefore(e,c);if(d.parentNode!=b){Sortable.options(b).onChange(e)}Sortable.options(d.parentNode).onChange(e)}}}},onEmptyHover:function(e,g,h){var j=e.parentNode;var a=Sortable.options(g);if(!Element.isParent(g,e)){var f;var c=Sortable.findElements(g,{tag:a.tag,only:a.only});var b=null;if(c){var d=Element.offsetSize(g,a.overlap)*(1-h);for(f=0;f=0){d-=Element.offsetSize(c[f],a.overlap)}else{if(d-(Element.offsetSize(c[f],a.overlap)/2)>=0){b=f+10?e.flatten():[])};Element.offsetSize=function(a,b){return a["offset"+((b=="vertical"||b=="height")?"Height":"Width")]};if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(b,c,a){b=$(b);this.element=b;this.update=$(c);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(a)}else{this.options=a||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(d,e){if(!e.style.position||e.style.position=="absolute"){e.style.position="absolute";Position.clone(d,e,{setHeight:false,offsetTop:d.offsetHeight})}Effect.Appear(e,{duration:0.15})};this.options.onHide=this.options.onHide||function(d,e){new Effect.Fade(e,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=10000;this.update.style.zIndex=10001;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(a);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(b){var a=Event.findElement(b,"LI");if(this.index!=a.autocompleteIndex){this.index=a.autocompleteIndex;this.render()}Event.stop(b)},onClick:function(b){var a=Event.findElement(b,"LI");this.index=a.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(a){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var a=0;a0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index0){d=Element.collectTextNodes(a[0],this.options.select)}}else{d=Element.collectTextNodesIgnoreClass(f,"informal")}var c=this.getTokenBounds();if(c[0]!=-1){var e=this.element.value.substr(0,c[0]);var b=this.element.value.substr(c[0]).match(/^\s+/);if(b){e+=b[0]}this.element.value=e+d+this.element.value.substr(c[1])}else{this.element.value=d}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,f)}},updateChoices:function(c){if(!this.changed&&this.hasFocus){this.update.innerHTML=c;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var a=0;a=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var a=this.getTokenBounds();return this.element.value.substring(a[0],a[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var e=this.element.value;if(e.strip().empty()){return[-1,0]}var f=arguments.callee.getFirstDifferencePos(e,this.oldElementValue);var h=(f==this.oldElementValue.length?1:0);var d=-1,c=e.length;var g;for(var b=0,a=this.options.tokens.length;bd){d=g}g=e.indexOf(this.options.tokens[b],f+h);if(-1!=g&&g"+f.substr(0,h.length)+""+f.substr(h.length)+"");break}else{if(h.length>=b.options.partialChars&&b.options.partialSearch&&j!=-1){if(b.options.fullSearch||/\s/.test(f.substr(j-1,1))){c.push("
  • "+f.substr(0,j)+""+f.substr(j,h.length)+""+f.substr(j+h.length)+"
  • ");break}}}j=b.options.ignoreCase?f.toLowerCase().indexOf(h.toLowerCase(),j+1):f.indexOf(h,j+1)}}if(c.length){d=d.concat(c.slice(0,b.options.choices-d.length))}return"
      "+d.join("")+"
    "}},a||{})}});Field.scrollFreeActivate=function(a){setTimeout(function(){Field.activate(a)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(c,b,a){this.url=b;this.element=c=$(c);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(a);Object.extend(this.options,a||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(a){if(!this._editing||a.ctrlKey||a.altKey||a.shiftKey){return}if(Event.KEY_ESC==a.keyCode){this.handleFormCancellation(a)}else{if(Event.KEY_RETURN==a.keyCode){this.handleFormSubmission(a)}}},createControl:function(g,c,b){var e=this.options[g+"Control"];var f=this.options[g+"Text"];if("button"==e){var a=document.createElement("input");a.type="submit";a.value=f;a.className="editor_"+g+"_button";if("cancel"==g){a.onclick=this._boundCancelHandler}this._form.appendChild(a);this._controls[g]=a}else{if("link"==e){var d=document.createElement("a");d.href="#";d.appendChild(document.createTextNode(f));d.onclick="cancel"==g?this._boundCancelHandler:this._boundSubmitHandler;d.className="editor_"+g+"_link";if(b){d.className+=" "+b}this._form.appendChild(d);this._controls[g]=d}}},createEditField:function(){var c=(this.options.loadTextURL?this.options.loadingText:this.getText());var b;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){b=document.createElement("input");b.type="text";var a=this.options.size||this.options.cols||0;if(0=this.options.rows?this.options.autoRows:this.options.rows);b.cols=this.options.cols||40}b.name=this.options.paramName;b.value=c;b.className="editor_field";if(this.options.submitOnBlur){b.onblur=this._boundSubmitHandler}this._controls.editor=b;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var b=this;function a(d,e){var c=b.options["text"+d+"Controls"];if(!c||e===false){return}b._form.appendChild(document.createTextNode(c))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}a("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);a("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");a("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(a){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(a){Event.stop(a)}},enterHover:function(a){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML.unescapeHTML()},handleAJAXFailure:function(a){this.triggerCallback("onFailure",a);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(a){this.wrapUp();if(a){Event.stop(a)}},handleFormSubmission:function(d){var b=this._form;var c=$F(this._controls.editor);this.prepareSubmission();var f=this.options.callback(b,c)||"";if(Object.isString(f)){f=f.toQueryParams()}f.editorId=this.element.id;if(this.options.htmlResponse){var a=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,a)}else{var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:f,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,a)}if(d){Event.stop(d)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(a){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){this._form.removeClassName(this.options.loadingClassName);var b=c.responseText;if(this.options.stripLoadedTextTags){b=b.stripTags()}this._controls.editor.value=b;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,a)},postProcessEditField:function(){var a=this.options.fieldPostCreation;if(a){$(this._controls.editor)["focus"==a?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(a){Object.extend(this.options,a)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var a;$H(Ajax.InPlaceEditor.Listeners).each(function(b){a=this[b.value].bind(this);this._listeners[b.key]=a;if(!this.options.externalControlOnly){this.element.observe(b.key,a)}if(this.options.externalControl){this.options.externalControl.observe(b.key,a)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(b,a){if("function"==typeof this.options[b]){this.options[b](this,a)}},unregisterListeners:function(){$H(this._listeners).each(function(a){if(!this.options.externalControlOnly){this.element.stopObserving(a.key,a.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(a.key,a.value)}}.bind(this))},wrapUp:function(a){this.leaveEditMode();this._boundComplete(a,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,c,b,a){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(c,b,a)},createEditField:function(){var a=document.createElement("select");a.name=this.options.paramName;a.size=1;this._controls.editor=a;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw ("Server returned an invalid collection representation.")}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(b){this._controls.editor.disabled=true;var a=this._controls.editor.firstChild;if(!a){a=document.createElement("option");a.value="";this._controls.editor.appendChild(a);a.selected=true}a.update((b||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(b){this._text=b.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,a)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(d){return 2===d.length?d:[d,d].flatten()});var b=("value" in this.options)?this.options.value:this._text;var a=this._collection.any(function(d){return d[0]==b}.bind(this));this._controls.editor.update("");var c;this._collection.each(function(e,d){c=document.createElement("option");c.value=e[0];c.selected=a?e[0]==b:0==d;c.appendChild(document.createTextNode(e[1]));this._controls.editor.appendChild(c)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(a){if(!a){return}function b(c,d){if(c in a||d===undefined){return}a[c]=d}b("cancelControl",(a.cancelLink?"link":(a.cancelButton?"button":a.cancelLink==a.cancelButton==false?false:undefined)));b("okControl",(a.okLink?"link":(a.okButton?"button":a.okLink==a.okButton==false?false:undefined)));b("highlightColor",a.highlightcolor);b("highlightEndColor",a.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(a){return Form.serialize(a)},onComplete:function(b,a){new Effect.Highlight(a,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(a){a.element.style.backgroundColor=a.options.highlightColor;if(a._effect){a._effect.cancel()}},onFailure:function(b,a){alert("Error communication with the server: "+b.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(a){a._effect=new Effect.Highlight(a.element,{startcolor:a.options.highlightColor,endcolor:a.options.highlightEndColor,restorecolor:a._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(b,a,c){this.delay=a||0.5;this.element=$(b);this.callback=c;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(a){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});if(!Control){var Control={}}Control.Slider=Class.create({initialize:function(d,a,b){var c=this;if(Object.isArray(d)){this.handles=d.collect(function(f){return $(f)})}else{this.handles=[$(d)]}this.track=$(a);this.options=b||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(e){return $(e)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(f,e){e=c.handles.length-1-e;c.setValue(parseFloat((Object.isArray(c.options.sliderValue)?c.options.sliderValue[e]:c.options.sliderValue)||c.range.start),e);f.makePositioned().observe("mousedown",c.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var a=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(b){Event.stopObserving(b,"mousedown",a.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(a){if(this.allowedValues){if(a>=this.allowedValues.max()){return(this.allowedValues.max())}if(a<=this.allowedValues.min()){return(this.allowedValues.min())}var c=Math.abs(this.allowedValues[0]-a);var b=this.allowedValues[0];this.allowedValues.each(function(d){var e=Math.abs(d-a);if(e<=c){b=d;c=e}});return b}if(a>this.range.end){return this.range.end}if(a0)&&(bthis.values[a+1])){b=this.values[a+1]}}b=this.getNearestValue(b);this.values[a]=b;this.value=this.values[0];this.handles[a].style[this.isVertical()?"top":"left"]=this.translateToPx(b);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(b,a){this.setValue(this.values[a||this.activeHandleIdx||0]+b,a||this.activeHandleIdx||0)},translateToPx:function(a){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(a-this.range.start))+"px"},translateToValue:function(a){return((a/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(b){var a=this.values.sortBy(Prototype.K);b=b||0;return $R(a[b],a[b+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var a=this;if(this.spans){$R(0,this.spans.length-1).each(function(b){a.setSpan(a.spans[b],a.getRange(b))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(b,a){if(this.isVertical()){b.style.top=this.translateToPx(a.start);b.style.height=this.translateToPx(a.end-a.start+this.range.start)}else{b.style.left=this.translateToPx(a.start);b.style.width=this.translateToPx(a.end-a.start+this.range.start)}},updateStyles:function(){this.handles.each(function(a){Element.removeClassName(a,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(c){if(Event.isLeftClick(c)){if(!this.disabled){this.active=true;var d=Event.element(c);var e=[Event.pointerX(c),Event.pointerY(c)];var a=d;if(a==this.track){var b=this.track.cumulativeOffset();this.event=c;this.setValue(this.translateToValue((this.isVertical()?e[1]-b[1]:e[0]-b[0])-(this.handleLength/2)));var b=this.activeHandle.cumulativeOffset();this.offsetX=(e[0]-b[0]);this.offsetY=(e[1]-b[1])}else{while((this.handles.indexOf(d)==-1)&&d.parentNode){d=d.parentNode}if(this.handles.indexOf(d)!=-1){this.activeHandle=d;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var b=this.activeHandle.cumulativeOffset();this.offsetX=(e[0]-b[0]);this.offsetY=(e[1]-b[1])}}}Event.stop(c)}},update:function(a){if(this.active){if(!this.dragging){this.dragging=true}this.draw(a);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(a)}},draw:function(b){var c=[Event.pointerX(b),Event.pointerY(b)];var a=this.track.cumulativeOffset();c[0]-=this.offsetX+a[0];c[1]-=this.offsetY+a[1];this.event=b;this.setValue(this.translateToValue(this.isVertical()?c[1]:c[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(a){if(this.active&&this.dragging){this.finishDrag(a,true);Event.stop(a)}this.active=false;this.dragging=false},finishDrag:function(a,b){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}});if(typeof(Control)=="undefined"){Control={}}var $proc=function(a){return typeof(a)=="function"?a:function(){return a}};var $value=function(a){return typeof(a)=="function"?a():a};Object.Event={extend:function(a){a._objectEventSetup=function(b){this._observers=this._observers||{};this._observers[b]=this._observers[b]||[]};a.observe=function(d,b){if(typeof(d)=="string"&&typeof(b)!="undefined"){this._objectEventSetup(d);if(!this._observers[d].include(b)){this._observers[d].push(b)}}else{for(var c in d){this.observe(c,d[c])}}};a.stopObserving=function(c,b){this._objectEventSetup(c);if(c&&b){this._observers[c]=this._observers[c].without(b)}else{if(c){this._observers[c]=[]}else{this._observers={}}}};a.observeOnce=function(d,c){var b=function(){c.apply(this,arguments);this.stopObserving(d,b)}.bind(this);this._objectEventSetup(d);this._observers[d].push(b)};a.notify=function(g){this._objectEventSetup(g);var d=[];var b=$A(arguments).slice(1);try{for(var c=0;c=e[0][0])&&(c[0]<=e[1][0])){this.element.style.left=c[0]+"px"}else{this.element.style.left=((c[0]=e[0][1])&&(c[1]<=e[1][1])){this.element.style.top=c[1]+"px"}else{this.element.style.top=((c[1]<=e[0][1])?e[0][1]:e[1][1])+"px"}}}else{if((!this.options.constraint)||(this.options.constraint=="horizontal")){b.left=c[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){b.top=c[1]+"px"}}if(b.visibility=="hidden"){b.visibility=""}}}}if(typeof(Prototype)=="undefined"){throw"Control.Window requires Prototype to be loaded."}if(typeof(IframeShim)=="undefined"){throw"Control.Window requires IframeShim to be loaded."}if(typeof(Object.Event)=="undefined"){throw"Control.Window requires Object.Event to be loaded."}Control.Window=Class.create({initialize:function(b,c){Control.Window.windows.push(this);this.container=false;this.isOpen=false;this.href=false;this.sourceContainer=false;this.ajaxRequest=false;this.remoteContentLoaded=false;this.numberInSequence=Control.Window.windows.length+1;this.indicator=false;this.effects={fade:false,appear:false};this.indicatorEffects={fade:false,appear:false};this.options=Object.extend({beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction,height:null,width:null,className:false,position:"center",offsetLeft:0,offsetTop:0,iframe:false,hover:false,indicator:false,closeOnClick:false,iframeshim:true,fade:false,fadeDuration:0.75,draggable:false,onDrag:Prototype.emptyFunction,resizable:false,minHeight:false,minWidth:false,maxHeight:false,maxWidth:false,onResize:Prototype.emptyFunction,constrainToViewport:false,method:"post",parameters:{},onComplete:Prototype.emptyFunction,onSuccess:Prototype.emptyFunction,onFailure:Prototype.emptyFunction,onException:Prototype.emptyFunction,onRemoteContentLoaded:Prototype.emptyFunction,insertRemoteContentAt:false},c||{});this.indicator=this.options.indicator?$(this.options.indicator):false;if(b){if(typeof(b)=="string"&&b.match(Control.Window.uriRegex)){this.href=b}else{this.container=$(b);this.createDefaultContainer(b);if(this.container&&((this.container.readAttribute("href")&&this.container.readAttribute("href")!="")||(this.options.hover&&this.options.hover!==true))){if(this.options.hover&&this.options.hover!==true){this.sourceContainer=$(this.options.hover)}else{this.sourceContainer=this.container;this.href=this.container.readAttribute("href");var a=this.href.match(/^#(.+)$/);if(a&&a[1]){this.container=$(a[1]);this.href=false}else{this.container=false}}this.sourceContainerOpenHandler=function(e){this.open(e);e.stop();return false}.bindAsEventListener(this);this.sourceContainerCloseHandler=function(e){this.close(e)}.bindAsEventListener(this);this.sourceContainerMouseMoveHandler=function(e){this.position(e)}.bindAsEventListener(this);if(this.options.hover){this.sourceContainer.observe("mouseenter",this.sourceContainerOpenHandler);this.sourceContainer.observe("mouseleave",this.sourceContainerCloseHandler);if(this.options.position=="mouse"){this.sourceContainer.observe("mousemove",this.sourceContainerMouseMoveHandler)}}else{this.sourceContainer.observe("click",this.sourceContainerOpenHandler)}}}}this.createDefaultContainer(b);if(this.options.insertRemoteContentAt===false){this.options.insertRemoteContentAt=this.container}var d={margin:0,position:"absolute",zIndex:Control.Window.initialZIndexForWindow()};if(this.options.width){d.width=$value(this.options.width)+"px"}if(this.options.height){d.height=$value(this.options.height)+"px"}this.container.setStyle(d);if(this.options.className){this.container.addClassName(this.options.className)}this.positionHandler=this.position.bindAsEventListener(this);this.outOfBoundsPositionHandler=this.ensureInBounds.bindAsEventListener(this);this.bringToFrontHandler=this.bringToFront.bindAsEventListener(this);this.container.observe("mousedown",this.bringToFrontHandler);this.container.hide();this.closeHandler=this.close.bindAsEventListener(this);if(this.options.iframeshim){this.iFrameShim=new IframeShim();this.iFrameShim.hide()}this.applyResizable();this.applyDraggable();Event.observe(window,"resize",this.outOfBoundsPositionHandler);this.notify("afterInitialize")},open:function(c){if(this.isOpen){this.bringToFront();return false}if(this.notify("beforeOpen")===false){return false}if(this.options.closeOnClick){if(this.options.closeOnClick===true){this.closeOnClickContainer=$(document.body)}else{if(this.options.closeOnClick=="container"){this.closeOnClickContainer=this.container}else{if(this.options.closeOnClick=="overlay"){Control.Overlay.load();this.closeOnClickContainer=Control.Overlay.container}else{this.closeOnClickContainer=$(this.options.closeOnClick)}}}this.closeOnClickContainer.observe("click",this.closeHandler)}if(this.href&&!this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=true;if(this.href.match(/\.(jpe?g|gif|png|tiff|bmp?)([?][^?]+)*$/i)){var a=new Element("img");a.observe("load",function(d){this.getRemoteContentInsertionTarget().insert(d);this.position();if(this.notify("onRemoteContentLoaded")!==false){if(this.options.indicator){this.hideIndicator()}this.finishOpen()}}.bind(this,a));a.writeAttribute("src",this.href)}else{if(!this.ajaxRequest){if(this.options.indicator){this.showIndicator()}this.ajaxRequest=new Ajax.Request(this.href,{method:this.options.method,parameters:this.options.parameters,onComplete:function(d){this.notify("onComplete",d);this.ajaxRequest=false}.bind(this),onSuccess:function(d){this.getRemoteContentInsertionTarget().insert(d.responseText);this.notify("onSuccess",d);if(this.notify("onRemoteContentLoaded")!==false){if(this.options.indicator){this.hideIndicator()}this.finishOpen()}}.bind(this),onFailure:function(d){this.notify("onFailure",d);if(this.options.indicator){this.hideIndicator()}}.bind(this),onException:function(d,f){this.notify("onException",d,f);if(this.options.indicator){this.hideIndicator()}}.bind(this)})}}return true}else{if(this.options.iframe&&!this.remoteContentLoaded){this.remoteContentLoaded=true;if(this.options.indicator){this.showIndicator()}this.getRemoteContentInsertionTarget().insert(Control.Window.iframeTemplate.evaluate({href:this.href}));var b=this.container.down("iframe");b.onload=function(){this.notify("onRemoteContentLoaded");if(this.options.indicator){this.hideIndicator()}b.onload=null}.bind(this)}}this.finishOpen(c);return true},close:function(a){if(!this.isOpen||this.notify("beforeClose",a)===false){return false}if(this.options.closeOnClick){this.closeOnClickContainer.stopObserving("click",this.closeHandler)}if(this.options.fade){this.effects.fade=new Effect.Fade(this.container,{queue:{position:"front",scope:"Control.Window"+this.numberInSequence},from:1,to:0,duration:this.options.fadeDuration/2,afterFinish:function(){if(this.iFrameShim){this.iFrameShim.hide()}this.isOpen=false;this.notify("afterClose")}.bind(this)})}else{this.container.hide();if(this.iFrameShim){this.iFrameShim.hide()}}if(this.ajaxRequest){this.ajaxRequest.transport.abort()}if(!(this.options.draggable||this.options.resizable)&&this.options.position=="center"){Event.stopObserving(window,"resize",this.positionHandler)}if(!this.options.draggable&&this.options.position=="center"){Event.stopObserving(window,"scroll",this.positionHandler)}if(this.options.indicator){this.hideIndicator()}if(!this.options.fade){this.isOpen=false;this.notify("afterClose")}return true},position:function(d){if(this.options.position=="mouse"){var g=[Event.pointerX(d),Event.pointerY(d)];this.container.setStyle({top:g[1]+$value(this.options.offsetTop)+"px",left:g[0]+$value(this.options.offsetLeft)+"px"});return}var h=this.container.getDimensions();var c=document.viewport.getDimensions();Position.prepare();var b=(Position.deltaX+Math.floor((c.width-h.width)/2));var a=(Position.deltaY+((c.height>h.height)?Math.floor((c.height-h.height)/2):0));if(this.options.position=="center"){this.container.setStyle({top:(h.height<=c.height)?((a!=null&&a>0)?a:0)+"px":0,left:(h.width<=c.width)?((b!=null&&b>0)?b:0)+"px":0})}else{if(this.options.position=="relative"){var g=this.sourceContainer.cumulativeOffset();var f=g[1]+$value(this.options.offsetTop);var e=g[0]+$value(this.options.offsetLeft);this.container.setStyle({top:(h.height<=c.height)?(this.options.constrainToViewport?Math.max(0,Math.min(c.height-(h.height),f)):f)+"px":0,left:(h.width<=c.width)?(this.options.constrainToViewport?Math.max(0,Math.min(c.width-(h.width),e)):e)+"px":0})}else{if(this.options.position.length){var f=$value(this.options.position[1])+$value(this.options.offsetTop);var e=$value(this.options.position[0])+$value(this.options.offsetLeft);this.container.setStyle({top:(h.height<=c.height)?(this.options.constrainToViewport?Math.max(0,Math.min(c.height-(h.height),f)):f)+"px":0,left:(h.width<=c.width)?(this.options.constrainToViewport?Math.max(0,Math.min(c.width-(h.width),e)):e)+"px":0})}}}if(this.iFrameShim){this.updateIFrameShimZIndex()}},ensureInBounds:function(){if(!this.isOpen){return}var a=document.viewport.getDimensions();var c=this.container.cumulativeOffset();var b=this.container.getDimensions();if(c.left+b.width>a.width){this.container.setStyle({left:(Math.max(0,a.width-b.width))+"px"})}if(c.top+b.height>a.height){this.container.setStyle({top:(Math.max(0,a.height-b.height))+"px"})}},bringToFront:function(){Control.Window.bringToFront(this);this.notify("bringToFront")},destroy:function(){this.container.stopObserving("mousedown",this.bringToFrontHandler);if(this.draggable){Draggables.removeObserver(this.container);this.draggable.handle.stopObserving("mousedown",this.bringToFrontHandler);this.draggable.destroy()}if(this.resizable){Resizables.removeObserver(this.container);this.resizable.handle.stopObserving("mousedown",this.bringToFrontHandler);this.resizable.destroy()}if(this.container&&!this.sourceContainer){this.container.remove()}if(this.sourceContainer){if(this.options.hover){this.sourceContainer.stopObserving("mouseenter",this.sourceContainerOpenHandler);this.sourceContainer.stopObserving("mouseleave",this.sourceContainerCloseHandler);if(this.options.position=="mouse"){this.sourceContainer.stopObserving("mousemove",this.sourceContainerMouseMoveHandler)}}else{this.sourceContainer.stopObserving("click",this.sourceContainerOpenHandler)}}if(this.iFrameShim){this.iFrameShim.destroy()}Event.stopObserving(window,"resize",this.outOfBoundsPositionHandler);Control.Window.windows=Control.Window.windows.without(this);this.notify("afterDestroy")},applyResizable:function(){if(this.options.resizable){if(typeof(Resizable)=="undefined"){throw"Control.Window requires resizable.js to be loaded."}var a=null;if(this.options.resizable===true){a=new Element("div",{className:"resizable_handle"});this.container.insert(a)}else{a=$(this.options.resziable)}this.resizable=new Resizable(this.container,{handle:a,minHeight:this.options.minHeight,minWidth:this.options.minWidth,maxHeight:this.options.constrainToViewport?function(b){return(document.viewport.getDimensions().height-parseInt(b.style.top||0))-(b.getHeight()-parseInt(b.style.height||0))}:this.options.maxHeight,maxWidth:this.options.constrainToViewport?function(b){return(document.viewport.getDimensions().width-parseInt(b.style.left||0))-(b.getWidth()-parseInt(b.style.width||0))}:this.options.maxWidth});this.resizable.handle.observe("mousedown",this.bringToFrontHandler);Resizables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){if(this.iFrameShim){this.updateIFrameShimZIndex()}this.notify("onResize")}.bind(this)))}},applyDraggable:function(){if(this.options.draggable){if(typeof(Draggables)=="undefined"){throw"Control.Window requires dragdrop.js to be loaded."}var a=null;if(this.options.draggable===true){a=new Element("div",{className:"draggable_handle"});this.container.insert(a)}else{a=$(this.options.draggable)}this.draggable=new Draggable(this.container,{handle:a,constrainToViewport:this.options.constrainToViewport,zindex:this.container.getStyle("z-index"),starteffect:function(){if(Prototype.Browser.IE){this.old_onselectstart=document.onselectstart;document.onselectstart=function(){return false}}}.bind(this),endeffect:function(){document.onselectstart=this.old_onselectstart}.bind(this)});this.draggable.handle.observe("mousedown",this.bringToFrontHandler);Draggables.addObserver(new Control.Window.LayoutUpdateObserver(this,function(){if(this.iFrameShim){this.updateIFrameShimZIndex()}this.notify("onDrag")}.bind(this)))}},createDefaultContainer:function(a){if(!this.container){this.container=new Element("div",{id:"control_window_"+this.numberInSequence});$(document.body).insert(this.container);if(typeof(a)=="string"&&$(a)==null&&!a.match(/^#(.+)$/)&&!a.match(Control.Window.uriRegex)){this.container.update(a)}}},finishOpen:function(a){this.bringToFront();if(this.options.fade){if(typeof(Effect)=="undefined"){throw"Control.Window requires effects.js to be loaded."}if(this.effects.fade){this.effects.fade.cancel()}this.effects.appear=new Effect.Appear(this.container,{queue:{position:"end",scope:"Control.Window."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2,afterFinish:function(){if(this.iFrameShim){this.updateIFrameShimZIndex()}this.isOpen=true;this.notify("afterOpen")}.bind(this)})}else{this.container.show()}this.position(a);if(!(this.options.draggable||this.options.resizable)&&this.options.position=="center"){Event.observe(window,"resize",this.positionHandler,false)}if(!this.options.draggable&&this.options.position=="center"){Event.observe(window,"scroll",this.positionHandler,false)}if(!this.options.fade){this.isOpen=true;this.notify("afterOpen")}return true},showIndicator:function(){this.showIndicatorTimeout=window.setTimeout(function(){if(this.options.fade){this.indicatorEffects.appear=new Effect.Appear(this.indicator,{queue:{position:"front",scope:"Control.Window.indicator."+this.numberInSequence},from:0,to:1,duration:this.options.fadeDuration/2})}else{this.indicator.show()}}.bind(this),Control.Window.indicatorTimeout)},hideIndicator:function(){if(this.showIndicatorTimeout){window.clearTimeout(this.showIndicatorTimeout)}this.indicator.hide()},getRemoteContentInsertionTarget:function(){return typeof(this.options.insertRemoteContentAt)=="string"?this.container.down(this.options.insertRemoteContentAt):$(this.options.insertRemoteContentAt)},updateIFrameShimZIndex:function(){if(this.iFrameShim){this.iFrameShim.positionUnder(this.container)}}});Object.extend(Control.Window,{windows:[],baseZIndex:9999,indicatorTimeout:250,iframeTemplate:new Template(''),uriRegex:/^(\/|\#|https?\:\/\/|[\w]+\/)/,bringToFront:function(a){Control.Window.windows=Control.Window.windows.without(a);Control.Window.windows.push(a);Control.Window.windows.each(function(c,d){var b=Control.Window.baseZIndex+d;c.container.setStyle({zIndex:b});if(c.isOpen){if(c.iFrameShim){c.updateIFrameShimZIndex()}}if(c.options.draggable){c.draggable.options.zindex=b}})},open:function(b,c){var a=new Control.Window(b,c);a.open();return a},initialZIndexForWindow:function(a){return Control.Window.baseZIndex+(Control.Window.windows.length-1)}});Object.Event.extend(Control.Window);Control.Window.LayoutUpdateObserver=Class.create({initialize:function(a,b){this.w=a;this.element=$(a.container);this.observer=b},onStart:Prototype.emptyFunction,onEnd:function(b,a){if(a.element==this.element&&this.iFrameShim){this.w.updateIFrameShimZIndex()}},onResize:function(b,a){if(a.element==this.element){this.observer(this.element)}},onDrag:function(b,a){if(a.element==this.element){this.observer(this.element)}}});Control.Overlay={id:"control_overlay",loaded:false,container:false,lastOpacity:0,styles:{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:9998},ieStyles:{position:"absolute",top:0,left:0,zIndex:9998},effects:{fade:false,appear:false},load:function(){if(Control.Overlay.loaded){return false}Control.Overlay.loaded=true;Control.Overlay.container=new Element("div",{id:Control.Overlay.id});$(document.body).insert(Control.Overlay.container);if(Prototype.Browser.IE){Control.Overlay.container.setStyle(Control.Overlay.ieStyles);Event.observe(window,"scroll",Control.Overlay.positionOverlay);Event.observe(window,"resize",Control.Overlay.positionOverlay);Control.Overlay.observe("beforeShow",Control.Overlay.positionOverlay)}else{Control.Overlay.container.setStyle(Control.Overlay.styles)}Control.Overlay.iFrameShim=new IframeShim();Control.Overlay.iFrameShim.hide();Event.observe(window,"resize",Control.Overlay.positionIFrameShim);Control.Overlay.container.hide();return true},unload:function(){if(!Control.Overlay.loaded){return false}Event.stopObserving(window,"resize",Control.Overlay.positionOverlay);Control.Overlay.stopObserving("beforeShow",Control.Overlay.positionOverlay);Event.stopObserving(window,"resize",Control.Overlay.positionIFrameShim);Control.Overlay.iFrameShim.destroy();Control.Overlay.container.remove();Control.Overlay.loaded=false;return true},show:function(a,b){if(Control.Overlay.notify("beforeShow")===false){return false}Control.Overlay.lastOpacity=a;if(b){if(typeof(Effect)=="undefined"){throw"Control.Window requires effects.js to be loaded."}if(Control.Overlay.effects.fade){Control.Overlay.effects.fade.cancel()}Control.Overlay.effects.appear=new Effect.Appear(Control.Overlay.container,{queue:{position:"end",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.positionIFrameShim();Control.Overlay.iFrameShim.show();Control.Overlay.notify("afterShow")},from:0,to:Control.Overlay.lastOpacity,duration:(b===true?0.75:b)/2})}else{Control.Overlay.container.setStyle({opacity:a||1});Control.Overlay.container.show();Control.Overlay.positionIFrameShim();Control.Overlay.iFrameShim.show();Control.Overlay.notify("afterShow")}return true},hide:function(a){if(Control.Overlay.notify("beforeHide")===false){return false}if(Control.Overlay.effects.appear){Control.Overlay.effects.appear.cancel()}Control.Overlay.iFrameShim.hide();if(a){Control.Overlay.effects.fade=new Effect.Fade(Control.Overlay.container,{queue:{position:"front",scope:"Control.Overlay"},afterFinish:function(){Control.Overlay.notify("afterHide")},from:Control.Overlay.lastOpacity,to:0,duration:(a===true?0.75:a)/2})}else{Control.Overlay.container.hide();Control.Overlay.notify("afterHide")}return true},positionIFrameShim:function(){if(Control.Overlay.container.visible()){Control.Overlay.iFrameShim.positionUnder(Control.Overlay.container)}},positionOverlay:function(){Control.Overlay.container.setStyle({width:document.body.clientWidth+"px",height:document.body.clientHeight+"px"})}};Object.Event.extend(Control.Overlay);Control.ToolTip=Class.create(Control.Window,{initialize:function($super,a,c,b){$super(c,Object.extend(Object.extend(Object.clone(Control.ToolTip.defaultOptions),b||{}),{position:"mouse",hover:a}))}});Object.extend(Control.ToolTip,{defaultOptions:{offsetLeft:10}});Control.Modal=Class.create(Control.Window,{initialize:function($super,a,b){Control.Modal.InstanceMethods.beforeInitialize.bind(this)();$super(a,Object.extend(Object.clone(Control.Modal.defaultOptions),b||{}))}});Object.extend(Control.Modal,{defaultOptions:{overlayOpacity:0.5,closeOnClick:"overlay"},current:false,open:function(a,b){var c=new Control.Modal(a,b);c.open();return c},close:function(){if(Control.Modal.current){Control.Modal.current.close()}},InstanceMethods:{beforeInitialize:function(){Control.Overlay.load();this.overlayFinishedOpening=false;this.observe("beforeOpen",Control.Modal.Observers.beforeOpen.bind(this));this.observe("afterOpen",Control.Modal.Observers.afterOpen.bind(this));this.observe("afterClose",Control.Modal.Observers.afterClose.bind(this))}},Observers:{beforeOpen:function(){if(!this.overlayFinishedOpening){Control.Overlay.observeOnce("afterShow",function(){this.overlayFinishedOpening=true;this.open()}.bind(this));Control.Overlay.show(this.options.overlayOpacity,this.options.fade?this.options.fadeDuration:false);throw $break}else{Control.Window.windows.without(this).invoke("close")}},afterOpen:function(){Control.Modal.current=this},afterClose:function(){Control.Overlay.hide(this.options.fade?this.options.fadeDuration:false);Control.Modal.current=false;this.overlayFinishedOpening=false}}});Control.LightBox=Class.create(Control.Window,{initialize:function($super,a,b){this.allImagesLoaded=false;if(b.modal){var b=Object.extend(Object.clone(Control.LightBox.defaultOptions),b||{});b=Object.extend(Object.clone(Control.Modal.defaultOptions),b);b=Control.Modal.InstanceMethods.beforeInitialize.bind(this)(b);$super(a,b)}else{$super(a,Object.extend(Object.clone(Control.LightBox.defaultOptions),b||{}))}this.hasRemoteContent=this.href&&!this.options.iframe;if(this.hasRemoteContent){this.observe("onRemoteContentLoaded",Control.LightBox.Observers.onRemoteContentLoaded.bind(this))}else{this.applyImageObservers()}this.observe("beforeOpen",Control.LightBox.Observers.beforeOpen.bind(this))},applyImageObservers:function(){var a=this.getImages();this.numberImagesToLoad=a.length;this.numberofImagesLoaded=0;a.each(function(b){b.observe("load",function(c){++this.numberofImagesLoaded;if(this.numberImagesToLoad==this.numberofImagesLoaded){this.allImagesLoaded=true;this.onAllImagesLoaded()}}.bind(this,b));b.hide()}.bind(this))},onAllImagesLoaded:function(){this.getImages().each(function(a){this.showImage(a)}.bind(this));if(this.hasRemoteContent){if(this.options.indicator){this.hideIndicator()}this.finishOpen()}else{this.open()}},getImages:function(){return this.container.select(Control.LightBox.imageSelector)},showImage:function(a){a.show()}});Object.extend(Control.LightBox,{imageSelector:"img",defaultOptions:{},Observers:{beforeOpen:function(){if(!this.hasRemoteContent&&!this.allImagesLoaded){throw $break}},onRemoteContentLoaded:function(){this.applyImageObservers();if(!this.allImagesLoaded){throw $break}}}});window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(d){var g=this;var f=navigator.userAgent.toLowerCase();var a=navigator.platform.toLowerCase();var h=navigator.vendor||"";if(h==="KDE"){this.isKonqueror=true;this.isSupported=false}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true}else{if(h.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(a.indexOf("mac")>-1)}else{if(f.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true}}}}}window.historyStorage.setup(d);if(this.isSafari){this.createSafari()}else{if(this.isOpera){this.createOpera()}}var b=this.getCurrentLocation();this.currentLocation=b;if(this.isIE){this.createIE(b)}var e=function(){g.firstLoad=null};this.addEventListener(window,"unload",e);if(this.isIE){this.ignoreLocationChange=true}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.ignoreLocationChange=false;this.fireOnNewListener=true}}var c=function(){g.checkLocation()};setInterval(c,100)},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.fireOnNewListener=true;this.firstLoad=false}}},addListener:function(a){this.listener=a;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false}},addEventListener:function(c,b,a){if(c.addEventListener){c.addEventListener(b,a,false)}else{if(c.attachEvent){c.attachEvent("on"+b,function(){a(window.event)})}}},add:function(c,d){if(this.isSafari){c=this.removeHash(c);historyStorage.put(c,d);this.currentLocation=c;window.location.hash=c;this.putSafariState(c)}else{var b=this;var a=function(){if(b.currentWaitTime>0){b.currentWaitTime=b.currentWaitTime-b.waitTime}c=b.removeHash(c);if(document.getElementById(c)&&b.debugMode){var f="Exception: History locations can not have the same value as _any_ IDs that might be in the document, due to a bug in IE; please ask the developer to choose a history location that does not match any HTML IDs in this document. The following ID is already taken and cannot be a location: "+c;throw new Error(f)}historyStorage.put(c,d);b.ignoreLocationChange=true;b.ieAtomicLocationChange=true;b.currentLocation=c;window.location.hash=c;if(b.isIE){b.iframe.src="js/lib/blank.html?"+c}b.ieAtomicLocationChange=false};window.setTimeout(a,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime}},isFirstLoad:function(){return this.firstLoad},getVersion:function(){return"0.6"},getCurrentLocation:function(){return this.getCurrentHash()},getCurrentHash:function(){var b=window.location.href;var a=b.indexOf("#");return(a>=0?b.substr(a+1):"")},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(a){this.waitTime=400;var b=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var d="rshHistoryFrame";var c='';document.write(c);this.iframe=document.getElementById(d)},createOpera:function(){this.waitTime=400;var a='';document.write(a)},createSafari:function(){var e="rshSafariForm";var d="rshSafariStack";var c="rshSafariLength";var b=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var a=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var f='
    ';document.write(f);this.safariStack=document.getElementById(d);this.safariLength=document.getElementById(c);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint}else{this.safariHistoryStartPoint=this.safariLength.value}},getSafariStack:function(){var a=this.safariStack.value;return historyStorage.fromJSON(a)},getSafariState:function(){var a=this.getSafariStack();var b=a[history.length-this.safariHistoryStartPoint-1];return b},putSafariState:function(b){var a=this.getSafariStack();a[history.length-this.safariHistoryStartPoint]=b;this.safariStack.value=historyStorage.toJSON(a)},fireHistoryEvent:function(a){var b=historyStorage.get(a);this.listener.call(null,a,b)},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;return}if(!this.isIE&&this.ieAtomicLocationChange){return}var a=this.getCurrentLocation();if(a==this.currentLocation){return}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=a){this.iframe.src="js/lib/blank.html?"+a}else{if(this.isIE){return}}this.currentLocation=a;this.ieAtomicLocationChange=false;this.fireHistoryEvent(a)},getIframeHash:function(){var b=this.iframe.contentWindow.document;var a=String(b.location.search);if(a.length==1&&a.charAt(0)=="?"){a=""}else{if(a.length>=2&&a.charAt(0)=="?"){a=a.substring(1)}}return a},removeHash:function(b){var a;if(b===null||b===undefined){a=null}else{if(b===""){a=""}else{if(b.length==1&&b.charAt(0)=="#"){a=""}else{if(b.length>1&&b.charAt(0)=="#"){a=b.substring(1)}else{a=b}}}}return a},iframeLoaded:function(a){if(this.ignoreLocationChange){this.ignoreLocationChange=false;return}var b=String(a.search);if(b.length==1&&b.charAt(0)=="?"){b=""}else{if(b.length>=2&&b.charAt(0)=="?"){b=b.substring(1)}}window.location.hash=b;this.fireHistoryEvent(b)}};window.historyStorage={setup:function(b){if(typeof b!=="undefined"){if(b.debugMode){this.debugMode=b.debugMode}if(b.toJSON){this.toJSON=b.toJSON}if(b.fromJSON){this.fromJSON=b.fromJSON}}var d="rshStorageForm";var f="rshStorageField";var a=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var e=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var c='
    ';document.write(c);this.storageField=document.getElementById(f);if(typeof window.opera!=="undefined"){this.storageField.focus()}},put:function(a,b){this.assertValidKey(a);if(this.hasKey(a)){this.remove(a)}this.storageHash[a]=b;this.saveHashTable()},get:function(a){this.assertValidKey(a);this.loadHashTable();var b=this.storageHash[a];if(b===undefined){b=null}return b},remove:function(a){this.assertValidKey(a);this.loadHashTable();delete this.storageHash[a];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash={}},hasKey:function(a){this.assertValidKey(a);this.loadHashTable();return(typeof this.storageHash[a]!=="undefined")},isValidKey:function(a){return(typeof a==="string")},showStyles:"border:0;margin:0;padding:0;",hideStyles:"width:0px;height:0px;border:0;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(a){var b=this.isValidKey(a);if(!b&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+a+".")}},loadHashTable:function(){if(!this.hashLoaded){var a=this.storageField.value;if(a!==""&&a!==null){this.storageHash=this.fromJSON(a);this.hashLoaded=true}}},saveHashTable:function(){this.loadHashTable();var a=this.toJSON(this.storageHash);this.storageField.value=a},toJSON:function(a){return a.toJSONString()},fromJSON:function(a){return a.parseJSON()}};Calendar=function(){function aS(b){typeof b=="string"&&(b=document.getElementById(b));return b}function aW(e,d,f){for(f=0;f=0;){aB(f,e[g],h)}}else{ab(e,h,f?h:null)}return f}function aa(d,c){return ab(d,c,c)}function ab(h,g,m){if(h){var l=h.className.replace(/^\s+|\s+$/,"").split(/\x20/),k=[],j;for(j=l.length;j>0;){l[--j]!=g&&k.push(l[j])}m&&k.push(m),h.className=k.join(" ")}return m}function ac(b){b=b||window.event,a3?(b.cancelBubble=!0,b.returnValue=!1):(b.preventDefault(),b.stopPropagation());return !1}function ad(g,e,k,j){if(g instanceof Array){for(var h=g.length;--h>=0;){ad(g[h],e,k)}}else{if(typeof e=="object"){for(var h in e){e.hasOwnProperty(h)&&ad(g,h,e[h],k)}}else{g.removeEventListener?g.removeEventListener(e,k,a3?!0:!!j):g.detachEvent?g.detachEvent("on"+e,k):g["on"+e]=null}}}function ae(g,e,k,j){if(g instanceof Array){for(var h=g.length;--h>=0;){ae(g[h],e,k,j)}}else{if(typeof e=="object"){for(var h in e){e.hasOwnProperty(h)&&ae(g,h,e[h],k)}}else{g.addEventListener?g.addEventListener(e,k,a3?!0:!!j):g.attachEvent?g.attachEvent("on"+e,k):g["on"+e]=k}}}function af(f,e,h,g){g={};for(h in e){e.hasOwnProperty(h)&&(g[h]=e[h])}for(h in f){f.hasOwnProperty(h)&&(g[h]=f[h])}return g}function ag(d){if(/\S/.test(d)){d=d.toLowerCase();function c(a){for(var e=a.length;--e>=0;){if(a[e].toLowerCase().indexOf(d)==0){return e+1}}}return c(ao("smn"))||c(ao("mn"))}}function ah(d){if(d){if(typeof d=="number"){return ak(d)}if(!(d instanceof Date)){var c=d.split(/-/);return new Date(parseInt(c[0],10),parseInt(c[1],10)-1,parseInt(c[2],10),12,0,0,0)}}return d}function ai(E,D){var C=E.getMonth(),B=E.getDate(),A=E.getFullYear(),z=an(E),y=E.getDay(),x=E.getHours(),w=x>=12,v=w?x-12:x,u=am(E),t=E.getMinutes(),s=E.getSeconds(),q=/%./g,p;v===0&&(v=12),p={"%a":ao("sdn")[y],"%A":ao("dn")[y],"%b":ao("smn")[C],"%B":ao("mn")[C],"%C":1+Math.floor(A/100),"%d":B<10?"0"+B:B,"%e":B,"%H":x<10?"0"+x:x,"%I":v<10?"0"+v:v,"%j":u<10?"00"+u:u<100?"0"+u:u,"%k":x,"%l":v,"%m":C<9?"0"+(1+C):1+C,"%o":1+C,"%M":t<10?"0"+t:t,"%n":"\n","%p":w?"PM":"AM","%P":w?"pm":"am","%s":Math.floor(E.getTime()/1000),"%S":s<10?"0"+s:s,"%t":"\t","%U":z<10?"0"+z:z,"%W":z<10?"0"+z:z,"%V":z<10?"0"+z:z,"%u":y+1,"%w":y,"%y":(""+A).substr(2,2),"%Y":A,"%%":"%"};return D.replace(q,function(b){return p.hasOwnProperty(b)?p[b]:b})}function aj(s,q,p){var o=s.getFullYear(),n=s.getMonth(),m=s.getDate(),l=q.getFullYear(),k=q.getMonth(),j=q.getDate();return ol?3:nk?2:p?0:mj?1:0}function ak(j,h,o,n,m){if(!(j instanceof Date)){j=parseInt(j,10);var l=Math.floor(j/10000);j=j%10000;var k=Math.floor(j/100);j=j%100,j=new Date(l,k-1,j,h==null?12:h,o==null?0:o,n==null?0:n,m==null?0:m)}return j}function al(b){if(b instanceof Date){return 10000*b.getFullYear()+100*(b.getMonth()+1)+b.getDate()}if(typeof b=="string"){return parseInt(b,10)}return b}function am(e){e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);var d=new Date(e.getFullYear(),0,1,12,0,0),f=e-d;return Math.floor(f/86400000)}function an(e){e=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);var d=e.getDay();e.setDate(e.getDate()-(d+6)%7+3);var f=e.valueOf();e.setMonth(0),e.setDate(4);return Math.round((f-e.valueOf())/604800000)+1}function ao(e,d){var f=aV.__.data[e];d&&typeof f=="string"&&(f=ap(f,d));return f}function ap(d,c){return d.replace(/\$\{([^:\}]+)(:[^\}]+)?\}/g,function(b,k,j){var h=c[k],g;j&&(g=j.substr(1).split(/\s*\|\s*/),h=(h>=g.length?g[g.length-1]:g[h]).replace(/##?/g,function(e){return e.length==2?"#":h}));return h})}function aq(C){if(!this._menuAnim){C=C||window.event;var B=C.target||C.srcElement,A=B.getAttribute("dyc-btn"),z=C.keyCode,y=C.charCode||z,x=at[z];if("year"==A&&z==13){var w=new Date(this.date);w.setDate(1),w.setFullYear(this._getInputYear()),this.moveTo(w,!0),aC(this,!1);return ac(C)}if(this._menuVisible){if(z==27){aC(this,!1);return ac(C)}}else{C.ctrlKey||(x=null),x==null&&!C.ctrlKey&&(x=ar[z]),z==36&&(x=0);if(x!=null){aD(this,x);return ac(C)}y=String.fromCharCode(y).toLowerCase();var v=this.els.yearInput,u=this.selection;if(y==" "){aC(this,!0),this.focus(),v.focus(),v.select();return ac(C)}if(y>="0"&&y<="9"){aC(this,!0),this.focus(),v.value=y,v.focus();return ac(C)}var t=ao("mn"),s=C.shiftKey?-1:this.date.getMonth(),q=0,p;while(++q<12){p=t[(s+q)%12].toLowerCase();if(p.indexOf(y)==0){var w=new Date(this.date);w.setDate(1),w.setMonth((s+q)%12),this.moveTo(w,!0);return ac(C)}}if(z>=37&&z<=40){var w=this._lastHoverDate;if(!w&&!u.isEmpty()){w=z<39?u.getFirstDate():u.getLastDate();if(wthis._lastDateVisible){w=null}}if(!w){w=z<39?this._lastDateVisible:this._firstDateVisible}else{var a=w;w=ak(w);var s=100;while(s-->0){switch(z){case 37:w.setDate(w.getDate()-1);break;case 38:w.setDate(w.getDate()-7);break;case 39:w.setDate(w.getDate()+1);break;case 40:w.setDate(w.getDate()+7)}if(!this.isDisabled(w)){break}}w=al(w),(wthis._lastDateVisible)&&this.moveTo(w)}ab(this._getDateDiv(a),aa(this._getDateDiv(w),"DynarchCalendar-hover-date")),this._lastHoverDate=w;return ac(C)}if(z==13&&this._lastHoverDate){u.type==bo.SEL_MULTIPLE&&(C.shiftKey||C.ctrlKey)?(C.shiftKey&&this._selRangeStart&&(u.clear(!0),u.selectRange(this._selRangeStart,this._lastHoverDate)),C.ctrlKey&&u.set(this._selRangeStart=this._lastHoverDate,!0)):u.reset(this._selRangeStart=this._lastHoverDate);return ac(C)}z==27&&!this.args.cont&&this.hide()}}}function au(){this.refresh();var e=this.inputField,d=this.selection;if(e){var f=d.print(this.dateFormat);/input|textarea/i.test(e.tagName)?e.value=f:e.innerHTML=f}this.callHooks("onSelect",this,d)}function av(g){g=g||window.event;var f=ay(g);if(f){var k=f.getAttribute("dyc-btn"),j=f.getAttribute("dyc-type"),h=g.wheelDelta?g.wheelDelta/120:-g.detail/3;h=h<0?-1:h>0?1:0,this.args.reverseWheel&&(h=-h);if(/^(time-(hour|min))/.test(j)){switch(RegExp.$1){case"time-hour":this.setHours(this.getHours()+h);break;case"time-min":this.setMinutes(this.getMinutes()+this.args.minuteStep*h)}ac(g)}else{/Y/i.test(k)&&(h*=2),aD(this,-h),ac(g)}}}function aw(g,f){f=f||window.event;var k=ay(f);if(k){var j=k.getAttribute("dyc-type");if(j&&!k.getAttribute("disabled")){if(!g||!this._bodyAnim||j!="date"){var h=k.getAttribute("dyc-cls");h=h?ax(h,0):"DynarchCalendar-hover-"+j,(j!="date"||this.selection.type)&&aB(g,k,h),j=="date"&&(aB(g,k.parentNode.parentNode,"DynarchCalendar-hover-week"),this._showTooltip(k.getAttribute("dyc-date"))),/^time-hour/.test(j)&&aB(g,this.els.timeHour,"DynarchCalendar-hover-time"),/^time-min/.test(j)&&aB(g,this.els.timeMinute,"DynarchCalendar-hover-time"),ab(this._getDateDiv(this._lastHoverDate),"DynarchCalendar-hover-date"),this._lastHoverDate=null}}}g||this._showTooltip()}function ax(d,c){return"DynarchCalendar-"+d.split(/,/)[c]}function ay(e){var d=e.target||e.srcElement,f=d;while(d&&d.getAttribute&&!d.getAttribute("dyc-type")){d=d.parentNode}return d.getAttribute&&d||f}function az(e){e=e||window.event;var d=this.els.topCont.style,f=a2(e,this._mouseDiff);d.left=f.x+"px",d.top=f.y+"px"}function aA(w,v){v=v||window.event;var u=ay(v);if(u&&!u.getAttribute("disabled")){var t=u.getAttribute("dyc-btn"),s=u.getAttribute("dyc-type"),q=u.getAttribute("dyc-date"),p=this.selection,o,n={mouseover:ac,mousemove:ac,mouseup:function(d){var c=u.getAttribute("dyc-cls");c&&ab(u,ax(c,1)),clearTimeout(o),ad(document,n,!0),n=null}};if(w){setTimeout(bq(this.focus,this),1);var e=u.getAttribute("dyc-cls");e&&aa(u,ax(e,1));if("menu"==t){this.toggleMenu()}else{if(u&&/^[+-][MY]$/.test(t)){if(aD(this,t)){var a=bq(function(){aD(this,t,!0)?o=setTimeout(a,40):(n.mouseup(),aD(this,t))},this);o=setTimeout(a,350),ae(document,n,!0)}else{n.mouseup()}}else{if("year"==t){this.els.yearInput.focus(),this.els.yearInput.select()}else{if(s=="time-am"){ae(document,n,!0)}else{if(/^time/.test(s)){var a=bq(function(b){aF.call(this,b),o=setTimeout(a,100)},this,s);aF.call(this,s),o=setTimeout(a,350),ae(document,n,!0)}else{q&&p.type&&(p.type==bo.SEL_MULTIPLE?v.shiftKey&&this._selRangeStart?p.selectRange(this._selRangeStart,q):(!v.ctrlKey&&!p.isSelected(q)&&p.clear(!0),p.set(q,!0),this._selRangeStart=q):(p.set(q),this.moveTo(ak(q),2)),u=this._getDateDiv(q),aw.call(this,!0,{target:u})),ae(document,n,!0)}}}}}a3&&n&&/dbl/i.test(v.type)&&n.mouseup(),!this.args.fixed&&/^(DynarchCalendar-(topBar|bottomBar|weekend|weekNumber|menu(-sep)?))?$/.test(u.className)&&!this.args.cont&&(n.mousemove=bq(az,this),this._mouseDiff=a2(v,a0(this.els.topCont)),ae(document,n,!0))}else{if("today"==t){!this._menuVisible&&p.type==bo.SEL_SINGLE&&p.set(new Date),this.moveTo(new Date,!0),aC(this,!1)}else{if(/^m([0-9]+)/.test(t)){var q=new Date(this.date);q.setDate(1),q.setMonth(RegExp.$1),q.setFullYear(this._getInputYear()),this.moveTo(q,!0),aC(this,!1)}else{s=="time-am"&&this.setHours(this.getHours()+12)}}}a3||ac(v)}}function aC(f,e){f._menuVisible=e,aB(e,f.els.title,"DynarchCalendar-pressed-title");var h=f.els.menu;a1&&(h.style.height=f.els.main.offsetHeight+"px");if(!f.args.animation){a4(h,e),f.focused&&f.focus()}else{f._menuAnim&&f._menuAnim.stop();var g=f.els.main.offsetHeight;a1&&(h.style.width=f.els.topBar.offsetWidth+"px"),e&&(h.firstChild.style.marginTop=-g+"px",f.args.opacity>0&&a6(h,0),a4(h,!0)),f._menuAnim=bn({onUpdate:function(b,a){h.firstChild.style.marginTop=a(a7.accel_b(b),-g,0,!e)+"px",f.args.opacity>0&&a6(h,a(a7.accel_b(b),0,0.85,!e))},onStop:function(){f.args.opacity>0&&a6(h,0.85),h.firstChild.style.marginTop="",f._menuAnim=null,e||(a4(h,!1),f.focused&&f.focus())}})}}function aD(f,e,h){this._bodyAnim&&this._bodyAnim.stop();var g;if(e!=0){g=new Date(f.date),g.setDate(1);switch(e){case"-Y":case -2:g.setFullYear(g.getFullYear()-1);break;case"+Y":case 2:g.setFullYear(g.getFullYear()+1);break;case"-M":case -1:g.setMonth(g.getMonth()-1);break;case"+M":case 1:g.setMonth(g.getMonth()+1)}}else{g=new Date}return f.moveTo(g,!h)}function aF(b){switch(b){case"time-hour+":this.setHours(this.getHours()+1);break;case"time-hour-":this.setHours(this.getHours()-1);break;case"time-min+":this.setMinutes(this.getMinutes()+this.args.minuteStep);break;case"time-min-":this.setMinutes(this.getMinutes()-this.args.minuteStep);break;default:return}}function aG(){this._bluringTimeout=setTimeout(bq(aH,this),50)}function aH(){this.focused=!1,ab(this.els.main,"DynarchCalendar-focused"),this._menuVisible&&aC(this,!1),this.args.cont||this.hide(),this.callHooks("onBlur",this)}function aI(){this._bluringTimeout&&clearTimeout(this._bluringTimeout),this.focused=!0,aa(this.els.main,"DynarchCalendar-focused"),this.callHooks("onFocus",this)}function aJ(f){var e=br("div"),h=f.els={},g={mousedown:bq(aA,f,!0),mouseup:bq(aA,f,!1),mouseover:bq(aw,f,!0),mouseout:bq(aw,f,!1),keypress:bq(aq,f)};f.args.noScroll||(g[aZ?"DOMMouseScroll":"mousewheel"]=bq(av,f)),a3&&(g.dblclick=g.mousedown,g.keydown=g.keypress),e.innerHTML=aP(f),bp(e.firstChild,function(d){var c=aK[d.className];c&&(h[c]=d),a3&&d.setAttribute("unselectable","on")}),ae(h.main,g),ae([h.focusLink,h.yearInput],f._focusEvents={focus:bq(aI,f),blur:bq(aG,f)}),f.moveTo(f.date,!1),f.setTime(null,!0);return h.topCont}function aL(f){function g(){h.showTime&&(e.push(""),aM(f,e),e.push(""))}var e=[],h=f.args;e.push(""),h.timePos=="left"&&g(),h.bottomBar&&(e.push(""),e.push("","
    ",ao("today"),"
    ",""),e.push("")),h.timePos=="right"&&g(),e.push("");return e.join("")}function aM(d,c){c.push("","","","","",""),d.args.showTime==12&&c.push("",""),c.push("","","","
    ")}function aN(h){var g=["
    ","","","","
    ",ao("goToday"),"
    ","

     

    ",""],m=ao("smn"),l=0,k=g.length,j;while(l<12){g[k++]="";for(j=4;--j>0;){g[k++]=""}g[k++]=""}g[k++]="
    "+m[l++]+"
    ";return g.join("")}function aO(b){return"
    "+ai(b.date,b.args.titleFormat)+"
    "}function aP(d){var c=["
    ","
    ",a3?"":"","
    ","
    ","
    ","
    ","
    ","
    ","
    ",aO(d),"
    ","
    ",aR(d),"
    ","
    ","
    "];(d.args.bottomBar||d.args.showTime)&&c.push("
    ",aL(d),"
    "),c.push("","
    ","
    ","
    ");return c.join("")}function aQ(N,M,L){M=M||N.date,L=L||N.fdow,M=new Date(M.getFullYear(),M.getMonth(),M.getDate(),12,0,0,0);var K=M.getMonth(),J=[],I=0,H=N.args.weekNumbers;M.setDate(1);var G=(M.getDay()-L)%7;G<0&&(G+=7),M.setDate(0-G),M.setDate(M.getDate()+1);var F=new Date,E=F.getDate(),D=F.getMonth(),C=F.getFullYear();J[I++]="";for(var B=0;B<6;++B){J[I++]="",H&&(J[I++]="");for(var A=0;A<7;++A){var z=M.getDate(),y=M.getMonth(),x=M.getFullYear(),w=10000*x+100*(y+1)+z,v=N.selection.isSelected(w),j=N.isDisabled(M);J[I++]="",M=new Date(x,y,z+1,12,0,0,0)}J[I++]=""}J[I++]="
    "+an(M)+"
    =0&&(J[I++]=" DynarchCalendar-weekend"),y!=K&&(J[I++]=" DynarchCalendar-day-othermonth"),z==E&&y==D&&x==C&&(J[I++]=" DynarchCalendar-day-today"),j&&(J[I++]=" DynarchCalendar-day-disabled"),v&&(J[I++]=" DynarchCalendar-day-selected"),j=N.args.dateInfo(M),j&&j.klass&&(J[I++]=" "+j.klass),J[I++]="'>"+z+"
    ";return J.join("")}function aR(f){var e=[""],h=0;f.args.weekNumbers&&e.push("
    ",ao("wk"),"
    ");while(h<7){var g=(h+++f.fdow)%7;e.push("=0?" class='DynarchCalendar-weekend'>":">",ao("sdn")[g],"")}e.push("");return e.join("")}function bo(a){a=a||{},this.args=a=af(a,{animation:!a1,cont:null,bottomBar:!0,date:!0,fdow:ao("fdow"),min:null,max:null,reverseWheel:!1,selection:[],selectionType:bo.SEL_SINGLE,weekNumbers:!1,align:"Bl/ / /T/r",inputField:null,trigger:null,dateFormat:"%Y-%m-%d",fixed:!1,opacity:a3?1:3,titleFormat:"%b %Y",showTime:!1,timePos:"right",time:!0,minuteStep:5,noScroll:!1,disabled:aT,checkRange:!1,dateInfo:aT,onChange:aT,onSelect:aT,onTimeChange:aT,onFocus:aT,onBlur:aT}),this.handlers={};var h=this,f=new Date;a.min=ah(a.min),a.max=ah(a.max),a.date===!0&&(a.date=f),a.time===!0&&(a.time=f.getHours()*100+Math.floor(f.getMinutes()/a.minuteStep)*a.minuteStep),this.date=ah(a.date),this.time=a.time,this.fdow=a.fdow,aW("onChange onSelect onTimeChange onFocus onBlur".split(/\s+/),function(b){var c=a[b];c instanceof Array||(c=[c]),h.handlers[b]=c}),this.selection=new bo.Selection(a.selection,a.selectionType,au,this);var e=aJ(this);a.cont&&aS(a.cont).appendChild(e),a.trigger&&this.manageFields(a.trigger,a.inputField,a.dateFormat)}var a9=navigator.userAgent,a8=/opera/i.test(a9),a5=/Konqueror|Safari|KHTML/i.test(a9),a3=/msie/i.test(a9)&&!a8&&!/mac_powerpc/i.test(a9),a1=a3&&/msie 6/i.test(a9),aZ=/gecko/i.test(a9)&&!a5&&!a8&&!a3,aX=bo.prototype,aV=bo.I18N={};bo.SEL_NONE=0,bo.SEL_SINGLE=1,bo.SEL_MULTIPLE=2,bo.SEL_WEEK=3,bo.dateToInt=al,bo.intToDate=ak,bo.printDate=ai,bo.formatString=ap,bo.i18n=ao,bo.LANG=function(e,d,f){aV.__=aV[e]={name:d,data:f}},bo.setup=function(a){return new bo(a)},aX.moveTo=function(N,M){var L=this;N=ah(N);var K=aj(N,L.date,!0),J,I=L.args,H=I.min&&aj(N,I.min),G=I.max&&aj(N,I.max);I.animation||(M=!1),aB(H!=null&&H<=1,[L.els.navPrevMonth,L.els.navPrevYear],"DynarchCalendar-navDisabled"),aB(G!=null&&G>=-1,[L.els.navNextMonth,L.els.navNextYear],"DynarchCalendar-navDisabled"),H<-1&&(N=I.min,J=1,K=0),G>1&&(N=I.max,J=2,K=0),L.date=N,L.refresh(!!M),L.callHooks("onChange",L,N,M);if(M&&(K!=0||M!=2)){L._bodyAnim&&L._bodyAnim.stop();var F=L.els.body,E=br("div","DynarchCalendar-animBody-"+aE[K],F),D=F.firstChild,C=a6(D)||0.7,B=J?a7.brakes:K==0?a7.shake:a7.accel_ab2,A=K*K>4,z=A?D.offsetTop:D.offsetLeft,y=E.style,x=A?F.offsetHeight:F.offsetWidth;K<0?x+=z:K>0?x=z-x:(x=Math.round(x/7),J==2&&(x=-x));if(!J&&K!=0){var w=E.cloneNode(!0),v=w.style,l=2*x;w.appendChild(D.cloneNode(!0)),v[A?"marginTop":"marginLeft"]=x+"px",F.appendChild(w)}D.style.visibility="hidden",E.innerHTML=aQ(L),L._bodyAnim=bn({onUpdate:function(d,c){var h=B(d);if(w){var e=c(h,x,l)+"px"}if(J){y[A?"marginTop":"marginLeft"]=c(h,x,0)+"px"}else{if(A||K==0){y.marginTop=c(K==0?B(d*d):h,0,x)+"px",K!=0&&(v.marginTop=e)}if(!A||K==0){y.marginLeft=c(h,0,x)+"px",K!=0&&(v.marginLeft=e)}}L.args.opacity>2&&w&&(a6(w,1-h),a6(E,h))},onStop:function(a){F.innerHTML=aQ(L,N),L._bodyAnim=null}})}L._lastHoverDate=null;return H>=-1&&G<=1},aX.isDisabled=function(d){var c=this.args;return c.min&&aj(d,c.min)<0||c.max&&aj(d,c.max)>0||c.disabled(d)},aX.toggleMenu=function(){aC(this,!this._menuVisible)},aX.refresh=function(d){var c=this.els;d||(c.body.innerHTML=aQ(this)),c.title.innerHTML=aO(this),c.yearInput.value=this.date.getFullYear()},aX.redraw=function(){var d=this,c=d.els;d.refresh(),c.dayNames.innerHTML=aR(d),c.menu.innerHTML=aN(d),c.bottomBar&&(c.bottomBar.innerHTML=aL(d)),bp(c.topCont,function(b){var a=aK[b.className];a&&(c[a]=b),b.className=="DynarchCalendar-menu-year"?(ae(b,d._focusEvents),c.yearInput=b):a3&&b.setAttribute("unselectable","on")}),d.setTime(null,!0)},aX.setLanguage=function(a){var d=bo.setLanguage(a);d&&(this.fdow=d.data.fdow,this.redraw())},bo.setLanguage=function(d){var c=aV[d];c&&(aV.__=c);return c},aX.focus=function(){try{this.els[this._menuVisible?"yearInput":"focusLink"].focus()}catch(b){}aI.call(this)},aX.blur=function(){this.els.focusLink.blur(),this.els.yearInput.blur(),aH.call(this)},aX.showAt=function(k,j,q){this._showAnim&&this._showAnim.stop(),q=q&&this.args.animation;var p=this.els.topCont,o=this,n=this.els.body.firstChild,m=n.offsetHeight,l=p.style;l.position="absolute",l.left=k+"px",l.top=j+"px",l.zIndex=10000,l.display="",q&&(n.style.marginTop=-m+"px",this.args.opacity>1&&a6(p,0),this._showAnim=bn({onUpdate:function(d,c){n.style.marginTop=-c(a7.accel_b(d),m,0)+"px",o.args.opacity>1&&a6(p,d)},onStop:function(){o.args.opacity>1&&a6(p,""),o._showAnim=null}}))},aX.hide=function(){var g=this.els.topCont,f=this,k=this.els.body.firstChild,j=k.offsetHeight,h=a0(g).y;this.args.animation?(this._showAnim&&this._showAnim.stop(),this._showAnim=bn({onUpdate:function(b,a){f.args.opacity>1&&a6(g,1-b),k.style.marginTop=-a(a7.accel_b(b),0,j)+"px",g.style.top=a(a7.accel_ab(b),h,h-10)+"px"},onStop:function(){g.style.display="none",k.style.marginTop="",f.args.opacity>1&&a6(g,""),f._showAnim=null}})):g.style.display="none",this.inputField=null},aX.popup=function(s,q){function k(a){var d={x:j.x,y:j.y};if(!a){return d}/B/.test(a)&&(d.y+=s.offsetHeight),/b/.test(a)&&(d.y+=s.offsetHeight-m.y),/T/.test(a)&&(d.y-=m.y),/l/.test(a)&&(d.x-=m.x-s.offsetWidth),/L/.test(a)&&(d.x-=m.x),/R/.test(a)&&(d.x+=s.offsetWidth),/c/i.test(a)&&(d.x+=(s.offsetWidth-m.x)/2),/m/i.test(a)&&(d.y+=(s.offsetHeight-m.y)/2);return d}s=aS(s),q||(q=this.args.align),q=q.split(/\x2f/);var p=a0(s),o=this.els.topCont,n=o.style,m,l=aY();n.visibility="hidden",n.display="",this.showAt(0,0),document.body.appendChild(o),m={x:o.offsetWidth,y:o.offsetHeight};var j=p;j=k(q[0]),j.yl.x+l.w&&(j.x=p.x,j=k(q[2])),j.y+m.y>l.y+l.h&&(j.y=p.y,j=k(q[3])),j.x=0){h[g]===e&&h.splice(g,1)}},aX.getTime=function(){return this.time},aX.setTime=function(g,f){if(this.args.showTime){g=g!=null?g:this.time,this.time=g;var k=this.getHours(),j=this.getMinutes(),h=k<12;this.args.showTime==12&&(k==0&&(k=12),k>12&&(k-=12),this.els.timeAM.innerHTML=ao(h?"AM":"PM")),k<10&&(k="0"+k),j<10&&(j="0"+j),this.els.timeHour.innerHTML=k,this.els.timeMinute.innerHTML=j,f||this.callHooks("onTimeChange",this,g)}},aX.getHours=function(){return Math.floor(this.time/100)},aX.getMinutes=function(){return this.time%100},aX.setHours=function(b){b<0&&(b+=24),this.setTime(100*(b%24)+this.time%100)},aX.setMinutes=function(b){b<0&&(b+=60),b=Math.floor(b/this.args.minuteStep)*this.args.minuteStep,this.setTime(100*this.getHours()+b%60)},aX._getInputYear=function(){var b=parseInt(this.els.yearInput.value,10);isNaN(b)&&(b=this.date.getFullYear());return b},aX._showTooltip=function(f){var e="",h,g=this.els.tooltip;f&&(f=ak(f),h=this.args.dateInfo(f),h&&h.tooltip&&(e="
    "+ai(f,h.tooltip)+"
    ")),g.innerHTML=e};var aU=" align='center' cellspacing='0' cellpadding='0'",aK={"DynarchCalendar-topCont":"topCont","DynarchCalendar-focusLink":"focusLink",DynarchCalendar:"main","DynarchCalendar-topBar":"topBar","DynarchCalendar-title":"title","DynarchCalendar-dayNames":"dayNames","DynarchCalendar-body":"body","DynarchCalendar-menu":"menu","DynarchCalendar-menu-year":"yearInput","DynarchCalendar-bottomBar":"bottomBar","DynarchCalendar-tooltip":"tooltip","DynarchCalendar-time-hour":"timeHour","DynarchCalendar-time-minute":"timeMinute","DynarchCalendar-time-am":"timeAM","DynarchCalendar-navBtn DynarchCalendar-prevYear":"navPrevYear","DynarchCalendar-navBtn DynarchCalendar-nextYear":"navNextYear","DynarchCalendar-navBtn DynarchCalendar-prevMonth":"navPrevMonth","DynarchCalendar-navBtn DynarchCalendar-nextMonth":"navNextMonth"},aE={"-3":"backYear","-2":"back",0:"now",2:"fwd",3:"fwdYear"},at={37:-1,38:-2,39:1,40:2},ar={33:-1,34:1};aX._getDateDiv=function(e){var d=null;if(e){try{bp(this.els.body,function(a){if(a.getAttribute("dyc-date")==e){throw d=a}})}catch(f){}}return d},(bo.Selection=function(f,e,h,g){this.type=e,this.sel=f instanceof Array?f:[f],this.onChange=bq(h,g),this.cal=g}).prototype={get:function(){return this.type==bo.SEL_SINGLE?this.sel[0]:this.sel},isEmpty:function(){return this.sel.length==0},set:function(a,h,g){var f=this.type==bo.SEL_SINGLE;a instanceof Array?(this.sel=a,this.normalize(),g||this.onChange(this)):(a=al(a),f||!this.isSelected(a)?(f?this.sel=[a]:this.sel.splice(this.findInsertPos(a),0,a),this.normalize(),g||this.onChange(this)):h&&this.unselect(a,g))},reset:function(){this.sel=[],this.set.apply(this,arguments)},countDays:function(){var h=0,g=this.sel,m=g.length,l,k,j;while(--m>=0){l=g[m],l instanceof Array&&(k=ak(l[0]),j=ak(l[1]),h+=Math.round(Math.abs(j.getTime()-k.getTime())/86400000)),++h}return h},unselect:function(s,q){s=al(s);var p=!1;for(var o=this.sel,n=o.length,m;--n>=0;){m=o[n];if(m instanceof Array){if(s>=m[0]&&s<=m[1]){var l=ak(s),k=l.getDate();if(s==m[0]){l.setDate(k+1),m[0]=al(l),p=!0}else{if(s==m[1]){l.setDate(k-1),m[1]=al(l),p=!0}else{var j=new Date(l);j.setDate(k+1),l.setDate(k-1),o.splice(n+1,0,[al(j),m[1]]),m[1]=al(l),p=!0}}}}else{s==m&&(o.splice(n,1),p=!0)}}p&&(this.normalize(),q||this.onChange(this))},normalize:function(){this.sel=this.sel.sort(function(d,c){d instanceof Array&&(d=d[0]),c instanceof Array&&(c=c[0]);return d-c});for(var j=this.sel,h=j.length,o,n;--h>=0;){o=j[h];if(o instanceof Array){if(o[0]>o[1]){j.splice(h,1);continue}o[0]==o[1]&&(o=j[h]=o[0])}if(n){var m=n,l=o instanceof Array?o[1]:o;l=ak(l),l.setDate(l.getDate()+1),l=al(l);if(l>=m){var k=j[h+1];o instanceof Array&&k instanceof Array?(o[1]=k[1],j.splice(h+1,1)):o instanceof Array?(o[1]=n,j.splice(h+1,1)):k instanceof Array?(k[0]=o,j.splice(h,1)):(j[h]=[o,k],j.splice(h+1,1))}}n=o instanceof Array?o[0]:o}},findInsertPos:function(f){for(var e=this.sel,h=e.length,g;--h>=0;){g=e[h],g instanceof Array&&(g=g[0]);if(g<=f){break}}return h+1},clear:function(b){this.sel=[],b||this.onChange(this)},selectRange:function(a,k){a=al(a),k=al(k);if(a>k){var j=a;a=k,k=j}var h=this.cal.args.checkRange;if(!h){return this._do_selectRange(a,k)}try{aW((new bo.Selection([[a,k]],bo.SEL_MULTIPLE,aT)).getDates(),bq(function(b){if(this.isDisabled(b)){h instanceof Function&&h(b,this);throw"OUT"}},this.cal)),this._do_selectRange(a,k)}catch(g){}},_do_selectRange:function(d,c){this.sel.push([d,c]),this.normalize(),this.onChange(this)},isSelected:function(e){for(var d=this.sel.length,f;--d>=0;){f=this.sel[d];if(f instanceof Array&&e>=f[0]&&e<=f[1]||e==f){return !0}}return !1},getFirstDate:function(){var b=this.sel[0];b&&b instanceof Array&&(b=b[0]);return b},getLastDate:function(){if(this.sel.length>0){var b=this.sel[this.sel.length-1];b&&b instanceof Array&&(b=b[1]);return b}},print:function(j,h){var o=[],n=0,m,l=this.cal.getHours(),k=this.cal.getMinutes();h||(h=" -> ");while(n=12&&(w-=12)));var s=function(){function b(c){F.push(c)}function l(){var c="";while(o()&&/[0-9]/.test(o())){c+=D()}if(n(o())){return m(c)}return parseInt(c,10)}function m(c){while(o()&&n(o())){c+=D()}return c}function o(){return C.charAt(G)}function D(){return C.charAt(G++)}var G=0,F=[],E,n=bo.isUnicodeLetter;while(G12?a>=1&&a<=31&&(x=a):q.push(a):z=a):y==null&&(y=ag(a))}q.length<2?q.length==1&&(x==null?x=q.shift():y==null&&(y=q.shift())):B?(y==null&&(y=q.shift()),x==null&&(x=q.shift())):(x==null&&(x=q.shift()),y==null&&(y=q.shift())),z==null&&(z=q.length>0?q.shift():A.getFullYear()),z<30?z+=2000:z<99&&(z+=1900),y==null&&(y=A.getMonth()+1);return z!=null&&y!=null&&x!=null?new Date(z,y-1,x,w,v,u):null};var a7={elastic_b:function(b){return 1-Math.cos(-b*5.5*Math.PI)/Math.pow(2,7*b)},magnetic:function(b){return 1-Math.cos(b*b*b*10.5*Math.PI)/Math.exp(4*b)},accel_b:function(b){b=1-b;return 1-b*b*b*b},accel_a:function(b){return b*b*b},accel_ab:function(b){b=1-b;return 1-Math.sin(b*b*Math.PI/2)},accel_ab2:function(b){return(b/=0.5)<1?0.5*b*b:-0.5*(--b*(b-2)-1)},brakes:function(b){b=1-b;return 1-Math.sin(b*b*Math.PI)},shake:function(b){return b<0.5?-Math.cos(b*11*Math.PI)*b*b:(b=1-b,Math.cos(b*11*Math.PI)*b*b)}},aT=new Function;return bo}();Calendar.LANG("fr","Français",{fdow:1,goToday:"Aujourd'hui",today:"Aujourd'hui",wk:"sm.",weekend:"0,6",AM:"am",PM:"pm",mn:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],smn:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aou","Sep","Oct","Nov","Déc"],dn:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi","Dimanche"],sdn:["Di","Lu","Ma","Me","Je","Ve","Sa","Di"]});Date.CultureInfo={name:"fr-FR",englishName:"French (France)",nativeName:"français (France)",dayNames:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],abbreviatedDayNames:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],shortestDayNames:["di","lu","ma","me","je","ve","sa"],firstLetterDayNames:["d","l","m","m","j","v","s"],monthNames:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],abbreviatedMonthNames:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],amDesignator:"",pmDesignator:"",firstDayOfWeek:1,twoDigitYearMax:2029,dateElementOrder:"dmy",formatPatterns:{shortDate:"dd/MM/yyyy",longDate:"dddd d MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"dddd d MMMM yyyy HH:mm:ss",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"d MMMM",yearMonth:"MMMM yyyy"},regexPatterns:{jan:/^janv(.(ier)?)?/i,feb:/^févr(.(ier)?)?/i,mar:/^mars/i,apr:/^avr(.(il)?)?/i,may:/^mai/i,jun:/^juin/i,jul:/^juil(.(let)?)?/i,aug:/^août/i,sep:/^sept(.(embre)?)?/i,oct:/^oct(.(obre)?)?/i,nov:/^nov(.(embre)?)?/i,dec:/^déc(.(embre)?)?/i,sun:/^di(m(.(anche)?)?)?/i,mon:/^lu(n(.(di)?)?)?/i,tue:/^ma(r(.(di)?)?)?/i,wed:/^me(r(.(credi)?)?)?/i,thu:/^je(u(.(di)?)?)?/i,fri:/^ve(n(.(dredi)?)?)?/i,sat:/^sa(m(.(edi)?)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(b){var e=Date.CultureInfo.monthNames,a=Date.CultureInfo.abbreviatedMonthNames,d=b.toLowerCase();for(var c=0;ca)?1:(this=c.getTime()&&b<=a.getTime()};Date.prototype.addMilliseconds=function(a){this.setMilliseconds(this.getMilliseconds()+a);return this};Date.prototype.addSeconds=function(a){return this.addMilliseconds(a*1000)};Date.prototype.addMinutes=function(a){return this.addMilliseconds(a*60000)};Date.prototype.addHours=function(a){return this.addMilliseconds(a*3600000)};Date.prototype.addDays=function(a){return this.addMilliseconds(a*86400000)};Date.prototype.addWeeks=function(a){return this.addMilliseconds(a*604800000)};Date.prototype.addMonths=function(a){var b=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+a);this.setDate(Math.min(b,this.getDaysInMonth()));return this};Date.prototype.addYears=function(a){return this.addMonths(a*12)};Date.prototype.add=function(b){if(typeof b=="number"){this._orient=b;return this}var a=b;if(a.millisecond||a.milliseconds){this.addMilliseconds(a.millisecond||a.milliseconds)}if(a.second||a.seconds){this.addSeconds(a.second||a.seconds)}if(a.minute||a.minutes){this.addMinutes(a.minute||a.minutes)}if(a.hour||a.hours){this.addHours(a.hour||a.hours)}if(a.month||a.months){this.addMonths(a.month||a.months)}if(a.year||a.years){this.addYears(a.year||a.years)}if(a.day||a.days){this.addDays(a.day||a.days)}return this};Date._validate=function(d,c,a,b){if(typeof d!="number"){throw new TypeError(d+" is not a Number.")}else{if(da){throw new RangeError(d+" is not a valid value for "+b+".")}}return true};Date.validateMillisecond=function(a){return Date._validate(a,0,999,"milliseconds")};Date.validateSecond=function(a){return Date._validate(a,0,59,"seconds")};Date.validateMinute=function(a){return Date._validate(a,0,59,"minutes")};Date.validateHour=function(a){return Date._validate(a,0,23,"hours")};Date.validateDay=function(c,a,b){return Date._validate(c,1,Date.getDaysInMonth(a,b),"days")};Date.validateMonth=function(a){return Date._validate(a,0,11,"months")};Date.validateYear=function(a){return Date._validate(a,1,9999,"seconds")};Date.prototype.set=function(b){var a=b;if(!a.millisecond&&a.millisecond!==0){a.millisecond=-1}if(!a.second&&a.second!==0){a.second=-1}if(!a.minute&&a.minute!==0){a.minute=-1}if(!a.hour&&a.hour!==0){a.hour=-1}if(!a.day&&a.day!==0){a.day=-1}if(!a.month&&a.month!==0){a.month=-1}if(!a.year&&a.year!==0){a.year=-1}if(a.millisecond!=-1&&Date.validateMillisecond(a.millisecond)){this.addMilliseconds(a.millisecond-this.getMilliseconds())}if(a.second!=-1&&Date.validateSecond(a.second)){this.addSeconds(a.second-this.getSeconds())}if(a.minute!=-1&&Date.validateMinute(a.minute)){this.addMinutes(a.minute-this.getMinutes())}if(a.hour!=-1&&Date.validateHour(a.hour)){this.addHours(a.hour-this.getHours())}if(a.month!==-1&&Date.validateMonth(a.month)){this.addMonths(a.month-this.getMonth())}if(a.year!=-1&&Date.validateYear(a.year)){this.addYears(a.year-this.getFullYear())}if(a.day!=-1&&Date.validateDay(a.day,this.getFullYear(),this.getMonth())){this.addDays(a.day-this.getDate())}if(a.timezone){this.setTimezone(a.timezone)}if(a.timezoneOffset){this.setTimezoneOffset(a.timezoneOffset)}return this};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.isLeapYear=function(){var a=this.getFullYear();return(((a%4===0)&&(a%100!==0))||(a%400===0))};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(a,b){var c=(a-this.getDay()+7*(b||+1))%7;return this.addDays((c===0)?c+=7*(b||+1):c)};Date.prototype.moveToMonth=function(c,a){var b=(c-this.getMonth()+12*(a||+1))%12;return this.addMonths((b===0)?b+=12*(a||+1):b)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};Date.prototype.getWeekOfYear=function(a){var h=this.getFullYear(),c=this.getMonth(),f=this.getDate();var k=a||Date.CultureInfo.firstDayOfWeek;var e=7+1-new Date(h,0,1).getDay();if(e==8){e=1}var b=((Date.UTC(h,c,f,0,0,0)-Date.UTC(h,0,1,0,0,0))/86400000)+1;var j=Math.floor((b-e+7)/7);if(j===k){h--;var g=7+1-new Date(h,0,1).getDay();if(g==2||g==8){j=53}else{j=52}}return j};Date.prototype.isDST=function(){console.log("isDST");return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(b){var a=this.getTimezoneOffset(),c=Number(b)*-6/10;this.addMinutes(c-a);return this};Date.prototype.setTimezone=function(a){return this.setTimezoneOffset(Date.getTimezoneOffset(a))};Date.prototype.getUTCOffset=function(){var b=this.getTimezoneOffset()*-10/6,a;if(b<0){a=(b-10000).toString();return a[0]+a.substr(2)}else{a=(b+10000).toString();return"+"+a.substr(1)}};Date.prototype.getDayName=function(a){return a?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(a){return a?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(c){var a=this;var b=function b(d){return(d.toString().length==1)?"0"+d:d};return c?c.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(d){switch(d){case"hh":return b(a.getHours()<13?a.getHours():(a.getHours()-12));case"h":return a.getHours()<13?a.getHours():(a.getHours()-12);case"HH":return b(a.getHours());case"H":return a.getHours();case"mm":return b(a.getMinutes());case"m":return a.getMinutes();case"ss":return b(a.getSeconds());case"s":return a.getSeconds();case"yyyy":return a.getFullYear();case"yy":return a.getFullYear().toString().substring(2,4);case"dddd":return a.getDayName();case"ddd":return a.getDayName(true);case"dd":return b(a.getDate());case"d":return a.getDate().toString();case"MMMM":return a.getMonthName();case"MMM":return a.getMonthName(true);case"MM":return b((a.getMonth()+1));case"M":return a.getMonth()+1;case"t":return a.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return a.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};Date.now=function(){return new Date()};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var a={};a[this._dateElement]=this;return Date.now().add(a)};Number.prototype.ago=function(){var a={};a[this._dateElement]=this*-1;return Date.now().add(a)};(function(){var g=Date.prototype,a=Number.prototype;var p=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),o=("january february march april may june july august september october november december").split(/\s/),n=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),m;var l=function(j){return function(){if(this._is){this._is=false;return this.getDay()==j}return this.moveToDayOfWeek(j,this._orient)}};for(var f=0;f0&&!B){try{n=k.call(this,m[1])}catch(A){B=true}}else{B=true}if(!B&&n[1].length===0){B=true}if(!B){var x=[];for(var v=0;v0){t[0]=t[0].concat(o[0]);t[1]=o[1]}}if(t[1].length1){k=Array.prototype.slice.call(arguments)}else{if(arguments[0] instanceof Array){k=arguments[0]}}if(k){for(var m=0,l=k.shift();m2)?k:(k+(((k+2000)Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")}var m=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){m.set({timezone:this.timezone})}else{if(this.timezoneOffset){m.set({timezoneOffset:this.timezoneOffset})}}return m},finish:function(g){g=(g instanceof Array)?f(g):[g];if(g.length===0){return null}for(var n=0;n0||a.offsetHeight>0},fastClassMatch:function(b,c,d){var d=d||1;if(!b.className){return false}var a=b.className.match(c);if(!a){return false}if(a.length<=d){return false}return a[d]}});JcmsAjaxRequest=Class.create();JcmsAjaxRequest.prototype={initialize:function(a){this.elm=a;this.effect=null;this.exception=null;this.callback=null;this.rpc=null;this._periodexec=null;this.waitState=true;this.timeout=20000;this.quiet=false;this.isOk=false;this.isDone=false;this.isUpdate=false;this.isEffect=false;this.isTimeout=false},asyncJsonCall:function(){this.isOk=false;this.isDone=false;this.isUpdate=false;this.isEffect=false;this.isTimeout=false;if(this.waitState){Ajax.setWaitState(true,this.elm)}try{if(this.effect){this.effect()}else{this.isEffect=true}if(this._timeoutFunc){clearTimeout(this._timeoutFunc)}this._timeoutFunc=setTimeout(function(){this.isTimeout=true;this._asyncResponseCallBack()}.bind(this),this.timeout);if(this.rpc){this.rpc()}}catch(a){this._handleException()}},asyncJsonCallPeriodical:function(b){var a=function(){if(this.isDone){return}if(JcmsJsContext&&!JcmsJsContext.hasFocus){return}this.asyncJsonCall.bind(this).defer()};this._periodexec=new PeriodicalExecuter(a.bind(this),b)},stopPeriodical:function(){if(this._periodexec){this._periodexec.stop()}this.dispose()},asyncJsonCallBack:function(b,a){if(b){this.returnValue=b}else{this.isOk=true}if(a){this.returnException=a}this.isDone=true;this._asyncResponseCallBack();if(this._periodexec){this.isDone=false}},asyncEffectCallBack:function(a){this.isEffect=true;this.workingEffect=a;this._asyncResponseCallBack()},_asyncResponseCallBack:function(){if(this.isTimeout){if(!this._timeoutFunc){return}this._handleException();return}if(!this.isDone){return}if(this.isUpdate){return}if(!this.isEffect){return}if(this.returnException){JcmsLogger.error("JcmsAjaxRequest",this.returnException.message," Error: ["+this.returnException.code+"]",this.returnException.name,"\n"+this.returnException.javaStack);this._handleException();return}if(this._timeoutFunc){clearTimeout(this._timeoutFunc)}this.isUpdate=true;try{if(this.callback){this.callback(this.returnValue,this.workingEffect)}}catch(a){JcmsLogger.error("JcmsAjaxRequest",a)}this._disposeResponse()},_disposeResponse:function(){if(this.waitState){Ajax.setWaitState(false,this.elm)}if(!this._periodexec){this.dispose()}},_handleException:function(a){if(!this.quiet){alert(I18N.glp("warn.json.sessiontimeout"))}if(this.exception){this.exception(this.returnException)}this._disposeResponse()},dispose:function(){this.elm=null;this.effect=null;this.exception=null;this.callback=null;this.rpc=null;this._timeoutFunc=null;this._periodexec=null;this.timeout=20000;this.quiet=false}};JcmsJsonRequest=Class.create();Object.extend(JcmsJsonRequest.prototype,JcmsAjaxRequest.prototype);if(!window.Ajax){var Ajax=new Object()}Object.extend(Ajax,{setWaitState:function(h,j){var c=parent?parent:window;var g=document;try{g=(parent&&parent.document)?parent.document:g}catch(f){}var a=g.getElementsByTagName("body")[0];if(!a){return}if(!Ajax.waitDiv){Ajax.waitDiv=g.createElement("DIV");Ajax.waitDiv.innerHTML=I18N.glp("info.msg.loading");Ajax.waitDiv.className="ajaxwait";Ajax.waitDiv.style.display="none";a.appendChild(Ajax.waitDiv)}var d="";var b="";if(h){b="wait";d=I18N.glp("info.msg.loading");Ajax.waitDiv.style.display="block"}else{Ajax.waitDiv.style.display="none"}try{if(c.status){c.status=d}}catch(f){}if(j){j.style.cursor=b}a.style.cursor=b},performAjaxRequest:function(e,f,h){var c=e;var g=c.indexOf("?");if(g>=0){e=c.substr(0,g);f=c.substr(g+1)}var a=new JcmsAjaxRequest();var b=function(){new Ajax.Request(e,{parameters:f,onComplete:a.asyncJsonCallBack.bind(a),onException:a._handleException.bind(a),onFailure:a._handleException.bind(a)})};var d=h||function(k,j){};a.rpc=b;a.callback=d;a.asyncJsonCall()},_styleSheetsAdded:$H(),_javaScriptsAdded:$H(),loadStyleSheet:function(e,d){var d=d?d:"all";if(Ajax._styleSheetsAdded.get(e)===true){JcmsLogger.debug("Ajax","StyleSheet already imported: ",e);return}JcmsLogger.info("Ajax","Import StyleSheet",e);Ajax.markStyleSheetLoaded(e);var b=document.getElementsByTagName("head")[0];var c=document.createElement("link");c.type="text/css";c.rel="stylesheet";c.media=d;c.href=e;b.appendChild(c);if(Prototype.Browser.IE){var a=function(){$(document.body).toggleClassName("fixIERenderingBugOnDynamicCssLoad")};a.defer()}},markStyleSheetLoaded:function(a){JcmsLogger.debug("Ajax","Mark StyleSheet loaded: ",a);Ajax._styleSheetsAdded.set(a,true)},markStyleSheetsLoaded:function(){$A(arguments).each(function(a){Ajax.markStyleSheetLoaded(a)})},loadJavaScript:function(c){if(Ajax._javaScriptsAdded.get(c)===true){JcmsLogger.debug("Ajax","JavaScript already imported: ",c);return}JcmsLogger.info("Ajax","Import JavaScript",c);Ajax.markJavaScriptLoaded(c);var a=document.getElementsByTagName("head")[0];var b=document.createElement("script");b.type="text/javascript";b.src=c;a.appendChild(b)},markJavaScriptLoaded:function(a){JcmsLogger.debug("Ajax","Mark JavaScript loaded: ",a);Ajax._javaScriptsAdded.set(a,true)},markJavaScriptsLoaded:function(){$A(arguments).each(function(a){Ajax.markJavaScriptLoaded(a)})}});Ajax.Responders.register({onException:function(b,a){alert(I18N.glp("warn.json.sessiontimeout"))}});if(!window.InputUtil){var InputUtil=new Object()}Object.extend(InputUtil,{focus:function(a){if(a.type&&a.type.toLowerCase()=="file"){return}if(a.focus){try{a.focus()}catch(b){}}if(a.value){a.value=a.value}},blur:function(a){if(a.type&&a.type.toLowerCase()=="file"){return}if(a.blur){try{a.blur()}catch(b){}}},getMeasurer:function(a){var c=$("tx-measurer");if(!c){c=new Element("div",{id:"tx-measurer"});InputUtil._measurer=c}a.parentNode.appendChild(c);c.style.width=a.getWidth()+"px";c.style.height=a.getHeight()+"px";c.style.overflow="auto";c.style.whiteSpace="normal";c.style.position="relative";var b=Util.getCSS(a,["font-family","font-size","margin","padding"]);c.setStyle({visibility:"hidden",fontFamily:b.fontFamily,fontSize:b.fontSize,margin:b.margin,padding:b.padding});c.style.marginTop="-"+(a.getHeight()+24)+"px";c.style.marginBottom="24px";return $(InputUtil._measurer)},getCharacterCoords:function(c,g){var f=InputUtil.getMeasurer(c);var e=c.value;var d=e.substring(0,g)+"|";d=(d||"").replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").split("\n").join("
    ");f.innerHTML=d;var b=f.down("I");var a=b.positionedOffset();return{left:a.left-(c.scrollLeft||0),top:a.top-(c.scrollTop||0)}},getSelection:function(m,c){var g=new Object();g.input=m;if(m.setSelectionRange){g.start=m.selectionStart;g.end=m.selectionEnd;g.value=m.value.substring(m.selectionStart,m.selectionEnd);g.gecko=true;g.scrolltop=m.scrollTop;g.scrollleft=m.scrollLeft}else{if(m.createTextRange){if(!m.ownerDocument){m.ownerDocument=document}var o=m.ownerDocument.selection.createRange();if(o.parentElement().tagName!="TEXTAREA"){g.start=0;g.end=0}else{if(o.text.length==0){var h=m.value;var k="~JCMSwiki~";o.text=k;var n=m.value;var j=n.indexOf(k);m.value=h;var s=n.substr(0,j).replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").split("\n").length-1;g.value="";InputUtil._setSelection(g,j,j);g.start=j;g.end=j}else{var k=o.getBookmark();var f=m.createTextRange();var b=m.createTextRange();var l=f.text;b.moveToBookmark(k);var q=b.text;f.setEndPoint("EndToStart",b);var a=f.text.length;var j=l.indexOf(q,a);var e=j+q.length;var d=l.substring(0,j).replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").split("\n").length-1;var p=d+q.replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").split("\n").length-1;a=j;e=e;g.start=a;g.end=e;g.value=b.text;InputUtil._setSelection(g,a,e)}}}}if(JcmsLogger.isDebug&&JcmsLogger.InputUtil){JcmsLogger.debug("InputUtil","getSelection: "+g.start+","+g.end+": "+g.value+"("+g.scrolltop+","+g.scrollleft+")")}return c?InputUtil._trimSelection(g):g},replaceSelection:function(g,a,b,h,j){g.focus();j=(j==undefined)?0:j;var h=h||InputUtil.getSelection(g,b);var c=g.value;if(h.gecko){g.value=c.substring(0,h.start+j)+a+c.substring(h.end);var f=h.value?h.value.length:0;InputUtil._setSelection(h,h.start+j,h.end+(a.length+j-f))}else{var e=g.ownerDocument.selection.createRange();var d=(e.text.length==0);e.moveStart("character",j);e.text=a;e.moveStart("character",-a.length+j);e.moveEnd("character",j);e.select()}},replaceRegexp:function(f,d,a,j,c,e,g){var g=g||InputUtil.getSelection(f,c);var h=g.value;if(!h&&!e){return}var b=h;if(!h){b=j.replace(/\$1/g,"")}else{if(h.match(d)){b=h.replace(d,a)}else{b=h.replace(/\s*([\S ]+)(\s*)/g,j+"$2")}}if(b==h){return}InputUtil.replaceSelection(f,b,c,g)},_setSelection:function(e,g,a){e.input.focus();if(e.gecko){e.input.setSelectionRange(g,g);if(e.scrollleft){e.input.scrollLeft=e.scrollleft}if(e.scrolltop){e.input.scrollTop=e.scrolltop}else{Element.fire(e.input,"keypress")}e.input.setSelectionRange(g,a)}else{if(e.input.createTextRange){var c=e.input.createTextRange();var f=e.input.value;var d=f.substring(0,g).replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").split("\n").length-1;var b=f.substring(g,a).replace(/\r\n/g,"\n").replace(/\n\r/g,"\n").split("\n").length-1;c.move("character",g-d);c.moveEnd("character",a-g);c.select()}}e.value=e.input.value.substring(g,a);e.start=g;e.end=a},_trimSelection:function(b){if(b.start>=b.end||!b.value){return b}var c=0;var a=0;while(b.value.charAt(c)==" "){c++}while(b.value.charAt(b.value.length-a-1)==" "){a++}if((c==0)&&(a==0)){return b}InputUtil._setSelection(b,b.start+c,b.end-a);return b}});"JCMS.util.StyleSheet".namespace({_ss:false,_getStyleSheet:function(){var b=JCMS.util.StyleSheet._ss;if(b){return b}if(document.createStyleSheet){JCMS.util.StyleSheet._ss=document.createStyleSheet()}else{var a=document.getElementsByTagName("head")[0];var c=document.createElement("style");c.type="text/css";a.appendChild(c);JCMS.util.StyleSheet._ss=c.sheet}return JCMS.util.StyleSheet._ss},_addRule:function(c,b){var a=JCMS.util.StyleSheet._getStyleSheet();if(a.addRule){a.addRule(c,b)}else{a.insertRule(c+"{"+b+"}",a.cssRules.length)}},putRule:function(d,c){var b=JCMS.util.StyleSheet._getStyleSheet();var e=$A(b.rules||b.cssRules);var a=e.find(function(g,f){if(g.selectorText!=d){return false}if(!c){if(b.deleteRule){b.deleteRule(f)}else{b.removeRule(f)}return true}if(g.style.cssText){g.style.cssText=c}else{g.cssText=c}return true});if(!a&&c){JCMS.util.StyleSheet._addRule(d,c)}},removeRule:function(a){JCMS.util.StyleSheet.putRule(a,false)}});if(!window.FormUtil){var FormUtil=new Object()}Object.extend(FormUtil,{toggleInputs:function(c,a,b){$A(a).each(function(e,d){Form.getInputs(c,false,e).each(function(f){f.disabled=!b})})},setInputValues:function(a,b){Form.getInputs(a,"text",false).each(function(c){var d=b[c.name];if(d!=undefined){c.value=d}})},imposeMaxLength:function(b,a){if(b.value.lengtha){b.value="";return false}else{b.value=b.value.substr(0,a-1);return false}}},submit:function(d){var d=$(d);var a=false;var c=false;if(d.hasClassName("ajax-refresh")){JCMS.ajax.Refresh.refreshFromElement(d);return false}if(d.tagName=="FORM"){a=d}else{if(d.form){a=$(d.form);if(d.type=="submit"){c=""+d.value}}else{a=d.fastUp("FORM");if(!a){return false}}}if(!c.blank()){var b=a.elements.action;if(b){$(b).name=c}else{var b=$(document.createElement("INPUT"));b.name=c;b.value="true";b.type="hidden";a.appendChild(b)}}if(a.onsubmit){a.onsubmit()}a.submit();return true},clearFields:function(a){var b=Event.element(a);if(!b){return}b.previousSiblings().findAll(function(c){return c.clear}).invoke("clear")},getCheckedValues:function(b,d){var c=$(document.forms[b]);var a=c.getInputs("checkbox",d).concat(c.getInputs("radio",d));a=a.findAll(function(e){return e.checked});return a.pluck("value").compact()},getRadioValue:function(b,a){if($(b).type&&$(b).type.toLowerCase()=="radio"){var a=$(b).name;var b=$(b).form}else{if($(b).tagName.toLowerCase()!="form"){return false}}var c=$(b).getInputs("radio",a).find(function(d){return d.checked});return(c)?$F(c):null},activatePlaceholders:function(){var b=navigator.userAgent.toLowerCase();if(b.indexOf("safari")>0){return false}var a=document.getElementsByTagName("input");for(var c=0;c0){return false}FormUtil.activatePlaceholderWithoutBrowserCheck(b)},activatePlaceholderWithoutBrowserCheck:function(a){a=$(a);if(a.readAttribute("type")=="text"){if(a.readAttribute("placeholder")&&a.readAttribute("placeholder").length>0){if(a.value==""){a.value=a.readAttribute("placeholder")}a.onclick=function(){if(this.value==this.readAttribute("placeholder")){this.value="";this.removeClassName("inactivePlaceHolder")}return false};a.onblur=function(){if(this.value.length<1){this.value=this.readAttribute("placeholder");this.addClassName("inactivePlaceHolder")}}}}}});if(!window.JcmsPrefs){var JcmsPrefs=new Object()}Object.extend(JcmsPrefs,{items:null,put:function(a,b){JcmsPrefs._init();JcmsPrefs.items[a]=b;JcmsPrefs._store()},get:function(b,a){JcmsPrefs._init();if(JcmsPrefs.items[b]!=undefined){return JcmsPrefs.items[b]}return a},_init:function(){if(JcmsPrefs.items){return}var cookieString=Cookie.get("JcmsPrefs");if(!cookieString){JcmsPrefs.items=new Object();return}eval("JcmsPrefs.items = "+cookieString)},_store:function(){if(!JcmsPrefs.items){return}var a=toJSON(JcmsPrefs.items);Cookie.write([{name:"JcmsPrefs",value:a,expires:new Date((new Date()).getTime()+(1000*60*60*24*30)),path:"/",domain:""}])}});if(!window.Util){var Util=new Object()}Object.extend(Util,{isInIFrame:function(){return window!=top},shakeIE:function(){if(Prototype.Browser.IE){$(document.body).toggleClassName("fixIERenderingBug");JcmsLogger.debug("ShakeIE","Warning slow IE6 ! Use instead CSS (position: relative; zoom:1)")}},toBoolean:function(b,a){if(typeof b=="boolean"){return b}if(b=="false"||b=="no"){return false}if(b=="true"||b=="yes"){return true}return a},cleanDOMElements:function(g,b,d,c){var e=$A([]);for(var f=g.firstChild;f;f=f.nextSibling){if(f.nodeType!=1){continue}var a=c||!d||f.className.indexOf(d)>=0;if(b){Util.cleanDOMElements(f,b,d,a)}var f=$(f);f.removeAttribute("id");f.stopObserving();if(a){f.removeAttribute("onclick");e.push(f)}}e.each(function(j,h){g.removeChild(j)})},isLeftClick:function(a){return JcmsJsContext.isIE||Event.isLeftClick(a)},replaceHtml:function(c,b){var a=(typeof c==="string"?document.getElementById(c):c);var d=document.createElement(a.nodeName);d.id=a.id;d.className=a.className;d.innerHTML=b;a.parentNode.replaceChild(d,a);return d},getViewportBounds:function(f){var b=0;var d=0;var a=0;var c=0;if(!f){f=self}var e=f.document;if(f.screenTop){a=f.screenLeft;c=f.screenTop}else{if(f.screenX){a=f.screenX;c=f.screenY}}if(f.innerHeight){b=f.innerWidth;d=f.innerHeight}else{if(e.documentElement&&f.document.documentElement.clientHeight){b=e.documentElement.clientWidth;d=e.documentElement.clientHeight}else{if(document.body){b=e.body.clientWidth;d=e.body.clientHeight}}}return{x:a,y:c,width:b,height:d}},resizeIframeToViewport:function(c){c=$(c);if(!c){return}var a=400;try{if(c.contentDocument){doc=c.contentDocument}else{if(c.contentWindow){doc=c.contentWindow.document}else{if(c.document){doc=c.document}else{return}}}a=doc.body.scrollHeight;Event.observe(c.contentWindow,"unload",function(){Util.resizeIframeToViewport.delay(2,this)}.bindAsEventListener(c))}catch(b){JcmsLogger.error("Util","resizeIframeToViewport",b)}c.style.height=Math.max(150,a)+"px"},_initIframe:function(c){var a=JCMS.ajax.Refresh.getFragment(c);if(!a){return}var d=new Date().getTime();a.select("IFRAME[height=100%]").each(function(f,e){Util.resizeIframeToViewport.defer(f)});var b=new Date().getTime();JcmsLogger.info("InitIFrame","Init IFrame"," in "+(b-d)+" ms")},observeDocument:function(a,b){if(Prototype.Browser.IE||Prototype.Browser.Chrome){Event.observe(document,a,b)}else{Event.observe(window,a,b)}},observeFocus:function(a,b){if(document.addEventListener){document.addEventListener("focus",a,true);document.addEventListener("blur",b,true)}else{document.observe("focusin",a);document.observe("focusout",b)}},_classToCallBack:$H(),_tagToCallBack:$H(),_focusToCallBack:$H(),_onLoadCB:function(){var c=Util._onClickCB.bindAsEventListener(this);Util.observeDocument("click",c);Util.observeDocument("jcms:click",c);var b=Util._onFocusCB.bindAsEventListener(this,"focus:in");var a=Util._onFocusCB.bindAsEventListener(this,"focus:out");Util.observeFocus(b,a)},_onFocusCB:function(b,a){var d=Event.element(b);if(!d||!d.fastUp){return}var d=d.fastUp(["INPUT","TEXTAREA","SELECT"],null,true,2);if(!d){return}if(d.type&&d.type=="hidden"){return}if(!d._init){d._init=true;document.fire("jcms:init-focus",{elmId:d.identify()})}var c=$w(d.className);c.each(function(g,f){var e=Util._focusToCallBack.get(g);if(Object.isFunction(e)){e(b,d,g,a)}}.bind(this))},_onClickCB:function(a){if(!(a.eventName==="jcms:click"||Util.isLeftClick(a))){return}var b=Event.element(a);if(!b||!b.fastUp){return}if(b.tagName=="IMG"){if(Util._onClickDispatch(b,a)){return}}b=b.fastUp(["A","BUTTON","INPUT","TEXTAREA","SELECT"],null,true,2);if(!b){return}Util._onClickDispatch(b,a)},_onClickDispatch:function(d,b){if(!d._init){d._init=true;document.fire("jcms:init",{elmId:d.identify()})}var a=false;var c=$w(d.className);c.each(function(g,f){var e=Util._classToCallBack.get(g);if(Object.isFunction(e)){e(b,d,g);a=true}}.bind(this));return a},observeClass:function(a,b){Util._classToCallBack.set(a,b)},observeFocusClass:function(a,b){Util._focusToCallBack.set(a,b)},getCSS:function(t,w,c){var g,m={},p,a,u=w instanceof Array;var d=document.defaultView&&document.defaultView.getComputedStyle;var e=/^-?\d+(?:px)?$/i,j=/^-?\d(?:\.\d+)?/,h=/\d$/,v,b;var o=u?w:[w];for(var q=0,l=o.length;q200){document.fire(this.eventName+":active",{idleTime:d,target:e,eX:b,eY:a})}}this.setTimer(e,b,a)},setTimer:function(c,b,a){this._idleTime=new Date();this._timer=setTimeout(function(){if(this._lastIdle==c){return}document.fire(this.eventName+":idle",{target:c,eX:b,eY:a});this._lastIdle=c}.bind(this),this.time)},_matchClassName:function(a){if(!this.className||!a||!this.className.any){return true}if(!a.className||!a.className.indexOf){return false}return this.className.any(function(b){return a.className.indexOf(b)>=0})}});var JcmsLogger={LEVEL_INFO:"info",LEVEL_DEBUG:"debug",LEVEL_WARN:"warn",LEVEL_ERROR:"error",isDebug:true&&window.console&&window.console.debug,Ajax:false,CtxMenuManager:false,CtxMenu:false,CtxMenuTrace:false,WikiToolbar:false,InputUtil:false,Autochooser:false,JcmsJsContext:false,Table:false,TinyMCE_JcmsPlugin:false,TinyMCE_JcmsPluginCB:false,DocChooser:false,TreeCat:false,Modal:false,JcmsAjaxRequest:false,AjaxRefresh:false,DHTMLHistory:false,ShakeIE:true,Widget:false,Plupload:true,_log:function(d,a){var b=a[0];var c=a[1];if(!window.console&&document.URL.indexOf("debug=true")>0&&d==JcmsLogger.LEVEL_INFO){alert($A(a).inspect())}if(!JcmsLogger._checkScope(d,b,c)){return}d=(d==undefined)?JcmsLogger.LEVEL_DEBUG:d;a[1]="["+d+"]["+b+"] "+c;a=$A(a).slice(1,a.length);if(window.console&&window.console[d]){window.console[d].apply(window.console,a)}},_checkScope:function(c,a,b){if((!b)||!JcmsLogger.isDebug){return false}c=(c==undefined)?JcmsLogger.LEVEL_DEBUG:c;if((!a)||(!JcmsLogger[a]&&c==JcmsLogger.LEVEL_DEBUG)){return false}return true},info:function(a,b){JcmsLogger._log(JcmsLogger.LEVEL_INFO,arguments)},debug:function(a,b){JcmsLogger._log(JcmsLogger.LEVEL_DEBUG,arguments)},warn:function(a,b){JcmsLogger._log(JcmsLogger.LEVEL_WARN,arguments)},error:function(a,b){JcmsLogger._log(JcmsLogger.LEVEL_ERROR,arguments)}};var Popup={reload:function(a){return Popup.redirect(false,a)},redirect:function(a,f){try{var d=f?window.opener:window;if(d.parent&&!d.tinyMCEPopup){d=d.parent}var c=d.document;var e=c.location;if(!a||e.href==a){e.reload(true)}else{e.href=a}}catch(b){JcmsLogger.warn("Popup.redirect",b,b.message)}},encode:function(a){return encodeURIComponent(a)},callback:function(){if(!window.opener){return false}if(window.opener.callback){window.opener.callback(arguments);return true}if(!window.opener.callbackLinkId){return false}window.opener.document.fire("popup:callback",{linkId:window.opener.callbackLinkId,args:arguments});return true},popupEvent:function(b){var a=$A(arguments);a.shift();return Popup.popupWindow.apply(b,a)},popupWindow:function(c,l,n,g,f,b,j,m,d,o){if(!f){f="no"}if(!n){n=320}if(!g){g=260}b="resizable="+(Util.toBoolean(b,true)?"yes":"no");j="scrollbars="+(Util.toBoolean(j,true)?"yes":"no");if(m==undefined){m=true}if(!navigator.jalios){navigator.jalios=new Object()}var a=navigator.jalios.popupWindow;if(!d){d=window}if(l){l=l.replace(new RegExp("[s:/.-]+","img"),"_");l=l.substr(0,48)}if(!l&&!d.opener){l="_blank"}else{if(!m&&a){navigator.jalios.popupCounter=navigator.jalios.popupCounter?navigator.jalios.popupCounter+1:1;l=l+"_"+navigator.jalios.popupCounter}}if(m&&a&&a.close){a.close()}try{var e="status="+f+",width="+n+",height="+g+",menubar=no,"+b+","+j;navigator.jalios.popupWindow=d.open(c,l,e);JcmsLogger.debug("Popup","popupWindow",c,e);a=navigator.jalios.popupWindow;if(!a){alert(I18N.glp("warn.popup.blocker"))}}catch(k){alert(I18N.glp("warn.popup.blocker"))}d.callback=o?function(h){o.apply(this,$A(h))}:false;d.callbackLinkId=this.tagName?$(this).identify():false;if(a&&a.focus){a.focus()}return false},autoResize:function(b,d,e){if(!d){d=55}if(!e){e=50}var c=$(b).getDimensions();var a=Util.getViewportBounds();var f=c.height+d;f=Math.min(f,self.screen.availHeight);if(a.y&&(f+a.y>self.screen.availHeight)){f=self.screen.availHeight-a.y}window.resizeTo(a.width,Math.max(e,f));Util.shakeIE()},isInPopup:function(){return !(opener==undefined)}};"JCMS.History".namespace({init:function(){dhtmlHistory.initialize();dhtmlHistory.addListener(JCMS.History._dhtmlHistoryListener)},_dhtmlHistoryListener:function(c,d){var a={newLocation:c,historyData:d};var b=function(){document.fire("history:change",a)};b.defer()},observe:function(a){document.observe("history:change",function(b){a(b.memo.newLocation,b.memo.historyData)})},add:function(a,b){if(!dhtmlHistory){return}dhtmlHistory.add(a,b)}});if(window.dhtmlHistory){var t0=new Date().getTime();window.dhtmlHistory.create({toJSON:function(a){return Object.toJSON(a)},fromJSON:function(a){return a.evalJSON()}});Event.observe(window,"load",function(){JCMS.History.init.defer()});var t1=new Date().getTime();JcmsLogger.info("DHTMLHistory","Init DHTML History"," in "+(t1-t0)+" ms")}document.getElementsBySelector=function(a){return $$(a)};